public final class GoogleJsonRpcHttpTransport extends Object
This implementation is thread-safe.
Warning: this is based on an undocumented experimental Google functionality that may stop working or change in behavior at any time. Beware of this risk if running this in production code.
| Modifier and Type | Class and Description |
|---|---|
static class |
GoogleJsonRpcHttpTransport.Builder
GoogleJsonRpcHttpTransport Builder. |
| Modifier | Constructor and Description |
|---|---|
|
GoogleJsonRpcHttpTransport(com.google.api.client.http.HttpTransport httpTransport,
com.google.api.client.json.JsonFactory jsonFactory)
Creates a new
GoogleJsonRpcHttpTransport with default values for RPC server, and
Content type and Accept headers. |
protected |
GoogleJsonRpcHttpTransport(com.google.api.client.http.HttpTransport httpTransport,
com.google.api.client.json.JsonFactory jsonFactory,
String rpcServerUrl,
String mimeType,
String accept)
Creates a new
GoogleJsonRpcHttpTransport. |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.client.http.HttpRequest |
buildPostRequest(com.google.api.client.json.rpc2.JsonRpcRequest request)
Builds a POST HTTP request for the JSON-RPC requests objects specified in the given JSON-RPC
request object.
|
com.google.api.client.http.HttpRequest |
buildPostRequest(List<com.google.api.client.json.rpc2.JsonRpcRequest> requests)
Builds a POST HTTP request for the JSON-RPC requests objects specified in the given JSON-RPC
request objects.
|
String |
getAccept()
Returns the Accept header used for requests.
|
com.google.api.client.http.HttpTransport |
getHttpTransport()
Returns the HTTP transport used for building requests.
|
com.google.api.client.json.JsonFactory |
getJsonFactory()
Returns the JSON factory used for building requests.
|
String |
getMimeType()
Returns the MIME type header used for requests.
|
String |
getRpcServerUrl()
Returns the RPC server URL.
|
public GoogleJsonRpcHttpTransport(com.google.api.client.http.HttpTransport httpTransport,
com.google.api.client.json.JsonFactory jsonFactory)
GoogleJsonRpcHttpTransport with default values for RPC server, and
Content type and Accept headers.httpTransport - HTTP transport required for building requests.jsonFactory - JSON factory to use for building requests.protected GoogleJsonRpcHttpTransport(com.google.api.client.http.HttpTransport httpTransport,
com.google.api.client.json.JsonFactory jsonFactory,
String rpcServerUrl,
String mimeType,
String accept)
GoogleJsonRpcHttpTransport.httpTransport - HTTP transport required for building requests.jsonFactory - JSON factory to use for building requests.rpcServerUrl - RPC server URL.mimeType - Content type header to use for requests.accept - Accept header to use for requests.public final com.google.api.client.http.HttpTransport getHttpTransport()
public final com.google.api.client.json.JsonFactory getJsonFactory()
public final String getRpcServerUrl()
public final String getMimeType()
public final String getAccept()
public com.google.api.client.http.HttpRequest buildPostRequest(com.google.api.client.json.rpc2.JsonRpcRequest request)
throws IOException
You may use JsonFactory.createJsonParser(java.io.InputStream) to get the
JsonParser, and JsonParser.parseAndClose(Class, CustomizeJsonParser).
request - JSON-RPC request objectIOExceptionpublic com.google.api.client.http.HttpRequest buildPostRequest(List<com.google.api.client.json.rpc2.JsonRpcRequest> requests) throws IOException
Note that the request will always use batching -- i.e. JSON array of requests -- even if there
is only one request. You may use JsonFactory.createJsonParser(java.io.InputStream) to
get the JsonParser, and
JsonParser.parseArrayAndClose(Collection, Class, CustomizeJsonParser) .
requests - JSON-RPC request objectsIOExceptionCopyright © 2010-2013 Google. All Rights Reserved.