|
||||||||||
| 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 handle(HttpRequest request) {
request.headers.authorization = "...";
}
});
}
| Field Summary | |
|---|---|
HttpRequestInitializer |
initializer
HTTP request initializer or null for none. |
HttpTransport |
transport
HTTP transport. |
| 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final HttpTransport transport
public final HttpRequestInitializer initializer
null for none.
This initializer is invoked before setting its HttpRequest.method,
HttpRequest.url, or HttpRequest.content.
| Method Detail |
|---|
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 | |||||||||