public class HttpRequestWithBody extends HttpRequest
body, urlhttpRequest, UTF_8| Constructor and Description |
|---|
HttpRequestWithBody(org.wisdom.api.http.HttpMethod method,
String url)
Creates the request.
|
| Modifier and Type | Method and Description |
|---|---|
HttpRequestWithBody |
basicAuth(String username,
String password)
Configures the authentication credentials.
|
RequestBodyEntity |
body(com.fasterxml.jackson.databind.JsonNode body)
Sets the content of the HTTP request to the given JSON body.
|
RequestBodyEntity |
body(String body)
Sets the content of the HTTP request to the given String body.
|
MultipartBody |
field(String name,
File file)
Adds a 'upload' file to the request.
|
MultipartBody |
field(String name,
Object value)
Adds a form's field to the request.
|
MultipartBody |
fields(Map<String,Object> parameters)
Adds form's fields to the request.
|
HttpRequestWithBody |
header(String name,
String value)
Adds a header to the request.
|
HttpRequestWithBody |
headers(Map<String,String> headers)
Adds a set of headers to the headers of the request.
|
getBody, getHeaders, getHttpMethod, getUrlasBinary, asBinaryAsync, asBinaryAsync, asHtml, asJson, asJsonAsync, asJsonAsync, asString, asStringAsync, asStringAsyncpublic HttpRequestWithBody(org.wisdom.api.http.HttpMethod method,
String url)
method - the HTTP methodurl - the urlpublic HttpRequestWithBody header(String name, String value)
header in class HttpRequestname - the header's namevalue - the header's valuepublic HttpRequestWithBody headers(Map<String,String> headers)
headers in class HttpRequestheaders - the headers to add to the current headers.public HttpRequestWithBody basicAuth(String username, String password)
basicAuth in class HttpRequestusername - the usernamepassword - the passwordpublic MultipartBody field(String name, Object value)
name - the field's namevalue - the field's valuepublic MultipartBody field(String name, File file)
name - the field's namefile - the file to uploadpublic MultipartBody fields(Map<String,Object> parameters)
parameters - the map of field names - valuespublic RequestBodyEntity body(com.fasterxml.jackson.databind.JsonNode body)
body - the json object to used as body.public RequestBodyEntity body(String body)
body - the body.Copyright © 2013–2015 Wisdom Framework. All rights reserved.