public abstract class HttpBindingData extends Object implements BindingData
Constructor and Description |
---|
HttpBindingData() |
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
List<String> values)
Add a HTTP header.
|
void |
addHeader(String name,
String value)
Add a HTTP header.
|
StringReader |
getBody()
Get the HTTP body.
|
String |
getBodyAsString()
Get the HTTP body.
|
ByteArrayInputStream |
getBodyBytes()
Get the HTTP body as byte array.
|
org.switchyard.component.http.ContentType |
getContentType()
Get the HTTP body's content type.
|
Map<String,List<String>> |
getHeaders()
Get the HTTP headers map.
|
void |
setBody(String body)
Set the HTTP body.
|
void |
setBodyBytes(byte[] body)
Set the HTTP body.
|
void |
setBodyFromReader(Reader reader)
Set the HTTP body using a reader.
|
void |
setBodyFromStream(InputStream is)
Set the HTTP body using a stream.
|
void |
setContentType(org.switchyard.component.http.ContentType contentType)
Set the HTTP body's content type.
|
void |
setHeaders(Map<String,List<String>> headers)
Set the HTTP headers map.
|
void |
writeBodyToStream(OutputStream os)
Writes the HTTP body to a stream.
|
public Map<String,List<String>> getHeaders()
public void setHeaders(Map<String,List<String>> headers)
headers
- a Map of headerspublic void addHeader(String name, List<String> values)
name
- the name of the headervalues
- a List of header valuespublic void addHeader(String name, String value)
name
- the name of the headervalue
- a header valuepublic StringReader getBody() throws UnsupportedEncodingException
UnsupportedEncodingException
- if content encoding is not supportedpublic String getBodyAsString() throws UnsupportedEncodingException
UnsupportedEncodingException
- if content encoding is not supportedpublic ByteArrayInputStream getBodyBytes()
public void setBodyFromStream(InputStream is) throws IOException
is
- the body as InputStreamIOException
- if content could not be readpublic void setBodyFromReader(Reader reader) throws IOException
reader
- the body as ReaderIOException
- if content could not be readpublic void writeBodyToStream(OutputStream os) throws IOException
os
- an OutputStream to write toIOException
- if content could not be writtenpublic void setBody(String body)
body
- the body as Stringpublic void setBodyBytes(byte[] body)
body
- the body as byte arraypublic org.switchyard.component.http.ContentType getContentType()
public void setContentType(org.switchyard.component.http.ContentType contentType)
contentType
- the content typeCopyright © 2013–2022 JBoss by Red Hat. All rights reserved.