com.google.api.client.http.json
Class JsonHttpRequest

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.http.json.JsonHttpRequest
All Implemented Interfaces:
Cloneable, Map<String,Object>

public class JsonHttpRequest
extends GenericData

JSON HTTP request to JsonHttpClient.

Since:
1.6
Author:
Ravi Mistry

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
JsonHttpRequest(JsonHttpClient client, HttpMethod method, String uriTemplate, Object content)
          Builds an instance of JsonHttpRequest.
 
Method Summary
 HttpRequest buildHttpRequest()
          Create an HttpRequest suitable for use against this service.
 GenericUrl buildHttpRequestUrl()
          Creates a new instance of GenericUrl suitable for use against this service.
 HttpResponse executeUnparsed()
          Sends the request to the server and returns the raw HttpResponse.
 JsonHttpClient getClient()
          Returns the JSON HTTP client which handles this request.
 Object getJsonContent()
          Returns a POJO that can be serialized into JSON or null for none.
 HttpMethod getMethod()
          Returns the HTTP Method type.
 String getUriTemplate()
          Returns the URI template.
 
Methods inherited from class com.google.api.client.util.GenericData
clone, entrySet, get, getUnknownKeys, put, putAll, remove, set, setUnknownKeys
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsonHttpRequest

public JsonHttpRequest(JsonHttpClient client,
                       HttpMethod method,
                       String uriTemplate,
                       Object content)
Builds an instance of JsonHttpRequest.

Parameters:
client - The JSON HTTP client which handles this request
method - HTTP Method type
uriTemplate - URI template for the path relative to the base URL specified in JSON HTTP client. If it starts with a "/" the base path from the base URL will be stripped out. The URI template can also be a full URL. URI template expansion is done using UriTemplate.expand(String, String, Object, boolean)
content - A POJO that can be serialized into JSON or null for none
Method Detail

getMethod

public final HttpMethod getMethod()
Returns the HTTP Method type.


getUriTemplate

public final String getUriTemplate()
Returns the URI template.


getJsonContent

public final Object getJsonContent()
Returns a POJO that can be serialized into JSON or null for none.


getClient

public final JsonHttpClient getClient()
Returns the JSON HTTP client which handles this request.


buildHttpRequestUrl

public final GenericUrl buildHttpRequestUrl()
Creates a new instance of GenericUrl suitable for use against this service.

Returns:
newly created GenericUrl

buildHttpRequest

public HttpRequest buildHttpRequest()
                             throws IOException
Create an HttpRequest suitable for use against this service. Subclasses may override if specific behavior is required.

Returns:
newly created HttpRequest
Throws:
IOException

executeUnparsed

public HttpResponse executeUnparsed()
                             throws IOException
Sends the request to the server and returns the raw HttpResponse. Subclasses may override if specific behavior is required.

Returns:
the HttpResponse
Throws:
IOException - if the request fails


Copyright © 2011-2012 Google. All Rights Reserved.