|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.http.HttpRequestFactory
public final class HttpRequestFactory
Thread-safe light-weight HTTP request factory layer on top of the HTTP transport that has an
optional HTTP request initializer
for initializing requests.
For example, to use a particular authorization header across all requests, use:
public static HttpRequestFactory createRequestFactory(HttpTransport transport) { return transport.createRequestFactory(new HttpRequestInitializer() { public void initialize(HttpRequest request) throws IOException { request.getHeaders().setAuthorization("..."); } }); }
Method Summary | |
---|---|
HttpRequest |
buildDeleteRequest(GenericUrl url)
Builds a DELETE request for the given URL. |
HttpRequest |
buildGetRequest(GenericUrl url)
Builds a GET request for the given URL. |
HttpRequest |
buildHeadRequest(GenericUrl url)
Builds a HEAD request for the given URL. |
HttpRequest |
buildPatchRequest(GenericUrl url,
HttpContent content)
Builds a PATCH request for the given URL and content. |
HttpRequest |
buildPostRequest(GenericUrl url,
HttpContent content)
Builds a POST request for the given URL and content. |
HttpRequest |
buildPutRequest(GenericUrl url,
HttpContent content)
Builds a PUT request for the given URL and content. |
HttpRequest |
buildRequest(HttpMethod method,
GenericUrl url,
HttpContent content)
Builds a request for the given HTTP method, URL, and content. |
HttpRequestInitializer |
getInitializer()
Returns the HTTP request initializer or null for none. |
HttpTransport |
getTransport()
Returns the HTTP transport. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public HttpTransport getTransport()
public HttpRequestInitializer getInitializer()
null
for none.
This initializer is invoked before setting its method, URL, or content.
public HttpRequest buildRequest(HttpMethod method, GenericUrl url, HttpContent content) throws IOException
method
- HTTP request methodurl
- HTTP request URL or null
for nonecontent
- HTTP request content or null
for none
IOException
public HttpRequest buildDeleteRequest(GenericUrl url) throws IOException
DELETE
request for the given URL.
url
- HTTP request URL or null
for none
IOException
public HttpRequest buildGetRequest(GenericUrl url) throws IOException
GET
request for the given URL.
url
- HTTP request URL or null
for none
IOException
public HttpRequest buildPostRequest(GenericUrl url, HttpContent content) throws IOException
POST
request for the given URL and content.
url
- HTTP request URL or null
for nonecontent
- HTTP request content or null
for none
IOException
public HttpRequest buildPutRequest(GenericUrl url, HttpContent content) throws IOException
PUT
request for the given URL and content.
url
- HTTP request URL or null
for nonecontent
- HTTP request content or null
for none
IOException
public HttpRequest buildPatchRequest(GenericUrl url, HttpContent content) throws IOException
PATCH
request for the given URL and content.
url
- HTTP request URL or null
for nonecontent
- HTTP request content or null
for none
IOException
public HttpRequest buildHeadRequest(GenericUrl url) throws IOException
HEAD
request for the given URL.
url
- HTTP request URL or null
for none
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |