|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.http.AbstractHttpContent
com.google.api.client.http.UrlEncodedContent
public class UrlEncodedContent
Implements support for HTTP form content encoding serialization of type application/x-www-form-urlencoded
as specified in the HTML 4.0 Specification.
Sample usage:
static void setContent(HttpRequest request, Object item) {
request.setContent(new UrlEncodedContent(item));
}
Implementation is not thread-safe.
Field Summary | |
---|---|
String |
contentType
Deprecated. (scheduled to be made private in 1.6) Use getType() or setType(java.lang.String) |
Object |
data
Deprecated. (scheduled to be made private final in 1.6) Use getData() or
setData(java.lang.Object) |
Constructor Summary | |
---|---|
UrlEncodedContent()
Deprecated. (scheduled to be removed in 1.6) Use UrlEncodedContent(Object) |
|
UrlEncodedContent(Object data)
|
Method Summary | |
---|---|
Object |
getData()
Returns the key name/value data or null for none. |
String |
getType()
Returns the content type or null for none. |
UrlEncodedContent |
setData(Object data)
Sets the key name/value data or null for none. |
UrlEncodedContent |
setType(String type)
Sets the content type or null for none. |
void |
writeTo(OutputStream out)
Writes the content to the given output stream. |
Methods inherited from class com.google.api.client.http.AbstractHttpContent |
---|
computeLength, getEncoding, getLength, retrySupported |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Deprecated public String contentType
getType()
or setType(java.lang.String)
UrlEncodedParser.CONTENT_TYPE
.
@Deprecated public Object data
getData()
or
setData(java.lang.Object)
null
for none.
Constructor Detail |
---|
@Deprecated public UrlEncodedContent()
UrlEncodedContent(Object)
public UrlEncodedContent(Object data)
data
- key name/value data or null
for noneMethod Detail |
---|
public String getType()
HttpContent
null
for none.
public void writeTo(OutputStream out) throws IOException
HttpContent
IOException
public UrlEncodedContent setType(String type)
null
for none.
Defaults to UrlEncodedParser.CONTENT_TYPE
.
public Object getData()
null
for none.
public UrlEncodedContent setData(Object data)
null
for none.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |