public class HttpRequestOptions extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpRequestOptions.FileStreamField
File field wrapper for use in form data body.
|
static class |
HttpRequestOptions.Method
Represents HTTP request methods supported by HttpClient
|
| Constructor and Description |
|---|
HttpRequestOptions(String url,
HttpRequestOptions.Method method)
Constructs HttpRequestOptions instance
|
| Modifier and Type | Method and Description |
|---|---|
Optional<Map<String,Object>> |
getBodyFields()
Returns fields of the request form data body
|
Optional<Object> |
getBodyJson()
Returns the json body of a request
|
Map<String,String> |
getHeaders()
Returns headers of request.
|
HttpRequestOptions.Method |
getMethod()
Returns HTTP method used for request
|
Map<String,Object> |
getQueryParameters()
Returns query parameters of request.
|
String |
getUrl()
Returns URL used for request
|
void |
setBody(Map<String,Object> fields)
Sets the form data body of a request.
|
void |
setBody(Object jsonBody)
Sets the json body of a request.
|
void |
setMethod(HttpRequestOptions.Method method)
Sets HTTP method used for request
|
void |
setUrl(String url)
Sets URL used for request
|
public HttpRequestOptions(String url, HttpRequestOptions.Method method)
url - request URLmethod - request methodpublic void setUrl(String url)
url - new request URLpublic String getUrl()
public void setMethod(HttpRequestOptions.Method method)
method - supported by HttpClient HTTP methodpublic HttpRequestOptions.Method getMethod()
public Map<String,Object> getQueryParameters()
Collection of parsable into
a string values.public Map<String,String> getHeaders()
public void setBody(Object jsonBody)
jsonBody - object that will be automatically converted into a json stringpublic void setBody(Map<String,Object> fields)
fields - map of form fields where the key is the name of a field and the value should be
an object that can be parsed as a string, but for files you should use HttpRequestOptions.FileStreamFieldpublic Optional<Object> getBodyJson()
Copyright © 2021. All rights reserved.