Constructor and Description |
---|
StringBodyImpl(java.lang.String string, java.lang.String contentType) |
Modifier and Type | Method and Description |
---|---|
JSONArray |
asJSONArray()
Return payload as JSON array
|
JSONObject |
asJSONObject()
Returns payload as JSON object
|
org.w3c.dom.Node |
asNode()
Returns payload as DOM object.
|
java.io.InputStream |
asStream()
Returns the payload as a stream
|
java.lang.String |
asString()
Returns the payload as a String
|
ContentType |
getContentType()
Returns the payload content type, if available
|
public StringBodyImpl(java.lang.String string, java.lang.String contentType) throws java.io.IOException
java.io.IOException
public java.io.InputStream asStream() throws java.io.IOException
Body
public java.lang.String asString() throws java.io.IOException
Body
public JSONObject asJSONObject() throws java.io.IOException
Body
asJSONObject
in interface Body
java.io.IOException
- if an error occurs during the payload retrieval or conversionpublic JSONArray asJSONArray() throws java.io.IOException
Body
asJSONArray
in interface Body
java.io.IOException
- if an error occurs during the payload retrieval or conversionpublic org.w3c.dom.Node asNode() throws java.io.IOException
Body
public ContentType getContentType()
Body
getContentType
in interface Body