public class HttpRequest extends BaseRequest
| Modifier and Type | Field and Description |
|---|---|
protected Body |
body
The payload of the request.
|
private Map<String,String> |
headers
The headers of the request.
|
private org.wisdom.api.http.HttpMethod |
httpMethod
The HTTP method of the request.
|
protected String |
url
The url os the request.
|
httpRequest, UTF_8| Constructor and Description |
|---|
HttpRequest(org.wisdom.api.http.HttpMethod method,
String url)
Creates a new request.
|
| Modifier and Type | Method and Description |
|---|---|
HttpRequest |
basicAuth(String username,
String password)
Configures the authentication credentials.
|
Body |
getBody() |
Map<String,String> |
getHeaders() |
org.wisdom.api.http.HttpMethod |
getHttpMethod() |
String |
getUrl() |
HttpRequest |
header(String name,
String value)
Adds a header to the request.
|
HttpRequest |
headers(Map<String,String> headers)
Adds a set of headers to the headers of the request.
|
private URL |
parseUrl(String s) |
asBinary, asBinaryAsync, asBinaryAsync, asHtml, asJson, asJsonAsync, asJsonAsync, asString, asStringAsync, asStringAsyncprivate org.wisdom.api.http.HttpMethod httpMethod
protected String url
protected Body body
public HttpRequest(org.wisdom.api.http.HttpMethod method,
String url)
method - the method, must not be nullurl - the url, must not be nullpublic HttpRequest basicAuth(String username, String password)
username - the usernamepassword - the passwordpublic HttpRequest header(String name, String value)
name - the header's name, must not be nullvalue - the header's value, must not be nullpublic HttpRequest headers(Map<String,String> headers)
headers - the headers to add to the current headers.public org.wisdom.api.http.HttpMethod getHttpMethod()
public String getUrl()
public Map<String,String> getHeaders()
public Body getBody()
Copyright © 2013–2014 Wisdom Framework. All rights reserved.