javagoogle-http-client

how to write HttpRequest with "get" Method


I'm using com.google.api.client.http

I want to send some request with this package.

HttpRequest request = new HttpRequest(new HttpTransport(),"GET");

But the HttpTransport in the package is abstract ,so it means I need to implement this class?

Is there anyone who can help me ?


Solution

  • You don't have to implement this class if the library supplies some concrete classes inheriting from this abstract class(unless none of them fits your needs). For example, ApacheHttpTransport, NetHttpTransport and UrlFetchTransport.