public class HttpMessage extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ACCEPT_ENCODING |
protected InputStream |
body |
static String |
CONTENT_ENCODING |
static String |
CONTENT_LENGTH |
static String |
CONTENT_TYPE |
static String |
DEFAULT_CHARSET |
List<Map.Entry<String,String>> |
headers |
String |
method |
static String |
REQUEST
The name of a dump entry whose value is the HTTP request.
|
static String |
RESPONSE
The name of a dump entry whose value is the HTTP response.
|
static String |
STATUS_CODE
The name of a dump entry whose value is the HTTP status code.
|
URL |
url |
Constructor and Description |
---|
HttpMessage() |
HttpMessage(String method,
URL url) |
HttpMessage(String method,
URL url,
InputStream body) |
Modifier and Type | Method and Description |
---|---|
void |
dump(Map<String,Object> into)
Put a description of this message and its origins into the given Map.
|
InputStream |
getBody() |
String |
getContentCharset() |
String |
getHeader(String name)
Get the value of the last header of the given name.
|
static HttpMessage |
newRequest(OAuthMessage from,
ParameterStyle style)
Construct an HTTP request from this OAuth message.
|
protected InputStream |
openBody() |
String |
removeHeaders(String name)
Remove all headers of the given name.
|
public String method
public URL url
protected InputStream body
public static final String REQUEST
public static final String RESPONSE
public static final String STATUS_CODE
public static final String ACCEPT_ENCODING
public static final String CONTENT_ENCODING
public static final String CONTENT_LENGTH
public static final String CONTENT_TYPE
public static final String DEFAULT_CHARSET
public HttpMessage()
public HttpMessage(String method, URL url, InputStream body)
public final String getHeader(String name)
public String removeHeaders(String name)
public final String getContentCharset()
public final InputStream getBody() throws IOException
IOException
protected InputStream openBody() throws IOException
IOException
public void dump(Map<String,Object> into) throws IOException
IOException
public static HttpMessage newRequest(OAuthMessage from, ParameterStyle style) throws IOException
style
- where to put the OAuth parameters, within the HTTP requestIOException
Copyright © 2023. All rights reserved.