com.google.appengine.api.urlfetch
Class HTTPRequest
- java.lang.Object
- 
- com.google.appengine.api.urlfetch.HTTPRequest
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 
 public class HTTPRequest extends java.lang.Object implements java.io.SerializableHTTPRequestencapsulates a single HTTP request that is made via theURLFetchService.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor and Description HTTPRequest(java.net.URL url)Creates aHTTPRequestthat represents a GET request to the specified URL.HTTPRequest(java.net.URL url, HTTPMethod method)Creates aHTTPRequestthat represents an HTTP request to the specified URL with the specified HTTP method (GET, POST, etc).HTTPRequest(java.net.URL url, HTTPMethod method, FetchOptions fetchOptions)Creates aHTTPRequestthat represents an HTTP request to the specified URL with the specified HTTP method (GET, POST, etc) and the specifiedFetchOptions.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddHeader(HTTPHeader header)Addsheaderto this request.FetchOptionsgetFetchOptions()Get the fetch options for this request.java.util.List<HTTPHeader>getHeaders()Returns an immutableListofHTTPHeaderobjects that have been added to this request.HTTPMethodgetMethod()Gets the HTTP method for this request (GET, POST, etc).byte[]getPayload()Gets the payload (such as POST body) for this request.java.net.URLgetURL()Gets the URL for this request.voidsetHeader(HTTPHeader header)Sets anHTTPHeaderfor this request.voidsetPayload(byte[] payload)Sets the payload for this request.
 
- 
- 
- 
Constructor Detail- 
HTTPRequestpublic HTTPRequest(java.net.URL url) Creates aHTTPRequestthat represents a GET request to the specified URL.
 - 
HTTPRequestpublic HTTPRequest(java.net.URL url, HTTPMethod method)Creates aHTTPRequestthat represents an HTTP request to the specified URL with the specified HTTP method (GET, POST, etc).
 - 
HTTPRequestpublic HTTPRequest(java.net.URL url, HTTPMethod method, FetchOptions fetchOptions)Creates aHTTPRequestthat represents an HTTP request to the specified URL with the specified HTTP method (GET, POST, etc) and the specifiedFetchOptions.
 
- 
 - 
Method Detail- 
getMethodpublic HTTPMethod getMethod() Gets the HTTP method for this request (GET, POST, etc).
 - 
getURLpublic java.net.URL getURL() Gets the URL for this request.
 - 
getPayloadpublic byte[] getPayload() Gets the payload (such as POST body) for this request. Certain HTTP methods (e.g. GET) will not have any payload, and this method will return null.
 - 
setPayloadpublic void setPayload(byte[] payload) Sets the payload for this request. This method should not be called for certain HTTP methods (e.g. GET).
 - 
addHeaderpublic void addHeader(HTTPHeader header) Addsheaderto this request. If anHTTPHeaderwith the samenamealready exists for this request, it's values are merged withheader.- Parameters:
- header- a not- null- HTTPHeader
 
 - 
setHeaderpublic void setHeader(HTTPHeader header) Sets anHTTPHeaderfor this request. If anHTTPHeaderwith the samenamealready exists, its value is replaced.
 - 
getHeaderspublic java.util.List<HTTPHeader> getHeaders() Returns an immutableListofHTTPHeaderobjects that have been added to this request.
 - 
getFetchOptionspublic FetchOptions getFetchOptions() Get the fetch options for this request.
 
- 
 
-