public class XmlHttpContent extends AbstractXmlHttpContentBeta
Serializes XML HTTP content based on the data key/value mapping object for an item.
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.
Constructors
XmlHttpContent(XmlNamespaceDictionary namespaceDictionary, String elementName, Object data)
public XmlHttpContent(XmlNamespaceDictionary namespaceDictionary, String elementName, Object data)XML namespace dictionary.
| Name | Description |
| namespaceDictionary | XmlNamespaceDictionaryXML namespace dictionary |
| elementName | StringXML element local name, optionally prefixed by its namespace alias, for
example |
| data | ObjectKey/value pair data |
Methods
getData()
public final Object getData()Returns the key/value pair data.
| Type | Description |
| Object |
getElementName()
public final String getElementName()Returns the XML element local name, optionally prefixed by its namespace alias, for example
"atom:entry".
| Type | Description |
| String |
setMediaType(HttpMediaType mediaType)
public XmlHttpContent setMediaType(HttpMediaType mediaType)Sets the media type to use for the Content-Type header, or null 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.
| Name | Description |
| mediaType | HttpMediaType |
| Type | Description |
| XmlHttpContent |
writeTo(XmlSerializer serializer)
public final void writeTo(XmlSerializer serializer)Writes the content to the given XML serializer.
| Name | Description |
| serializer | org.xmlpull.v1.XmlSerializer |
| Type | Description |
| IOException |