public class XmlHttpContent extends AbstractXmlHttpContent
Sample usage:
static void setContent(HttpRequest request, XmlNamespaceDictionary namespaceDictionary,
String elementName, Object data) {
request.setContent(new XmlHttpContent(namespaceDictionary, elementName, data));
}
Implementation is not thread-safe.
| Constructor and Description |
|---|
XmlHttpContent(XmlNamespaceDictionary namespaceDictionary,
String elementName,
Object data)
XML namespace dictionary.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getData()
Returns the key/value pair data.
|
String |
getElementName()
Returns the XML element local name, optionally prefixed by its namespace alias, for example
"atom:entry". |
XmlHttpContent |
setMediaType(HttpMediaType mediaType)
Sets the media type to use for the Content-Type header, or
null if unspecified. |
void |
writeTo(org.xmlpull.v1.XmlSerializer serializer)
Writes the content to the given XML serializer.
|
getNamespaceDictionary, writeTocomputeLength, getCharset, getEncoding, getLength, getMediaType, getType, retrySupportedpublic XmlHttpContent(XmlNamespaceDictionary namespaceDictionary, String elementName, Object data)
namespaceDictionary - XML namespace dictionaryelementName - XML element local name, optionally prefixed by its namespace alias, for
example "atom:entry"data - Key/value pair datapublic final void writeTo(org.xmlpull.v1.XmlSerializer serializer)
throws IOException
AbstractXmlHttpContentwriteTo in class AbstractXmlHttpContentIOException - I/O exceptionpublic XmlHttpContent setMediaType(HttpMediaType mediaType)
AbstractHttpContentnull if unspecified.
This will also overwrite any previously set parameter of the media type (for example
"charset"), and therefore might change other properties as well.
setMediaType in class AbstractXmlHttpContentpublic final String getElementName()
"atom:entry".public final Object getData()
Copyright © 2011-2012 Google. All Rights Reserved.