@Beta public class XmlHttpContent extends AbstractXmlHttpContent
Beta
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, writeTo
computeLength, computeLength, getCharset, getLength, getMediaType, getType, retrySupported
public 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
AbstractXmlHttpContent
writeTo
in class AbstractXmlHttpContent
IOException
- I/O exceptionpublic XmlHttpContent setMediaType(HttpMediaType mediaType)
AbstractHttpContent
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.
setMediaType
in class AbstractXmlHttpContent
public final String getElementName()
"atom:entry"
.public final Object getData()
Copyright © 2011–2021 Google. All rights reserved.