public class RequestOptions extends Object
HttpClient
will make connect to make a request.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HOST
The default value for host name = "localhost"
|
static int |
DEFAULT_PORT
The default value for port = 80
|
static Boolean |
DEFAULT_SSL
SSL enabled by default = false
|
static String |
DEFAULT_URI
The default relative request URI = ""
|
Constructor and Description |
---|
RequestOptions()
Default constructor
|
RequestOptions(JsonObject json)
Create options from JSON
|
RequestOptions(RequestOptions other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
RequestOptions |
addHeader(String key,
String value)
Add a request header.
|
MultiMap |
getHeaders()
Get the request headers
|
String |
getHost()
Get the host name to be used by the client request.
|
int |
getPort()
Get the port to be used by the client request.
|
String |
getURI() |
Boolean |
isSsl() |
RequestOptions |
setHeaders(MultiMap headers)
Set request headers from a multi-map.
|
RequestOptions |
setHost(String host)
Set the host name to be used by the client request.
|
RequestOptions |
setPort(int port)
Set the port to be used by the client request.
|
RequestOptions |
setSsl(Boolean ssl)
Set whether SSL/TLS is enabled
|
RequestOptions |
setURI(String uri)
Set the request relative URI
|
JsonObject |
toJson() |
public static final String DEFAULT_HOST
public static final int DEFAULT_PORT
public static final Boolean DEFAULT_SSL
public static final String DEFAULT_URI
public RequestOptions()
public RequestOptions(RequestOptions other)
other
- the options to copypublic RequestOptions(JsonObject json)
json
- the JSONpublic String getHost()
public RequestOptions setHost(String host)
public int getPort()
public RequestOptions setPort(int port)
public Boolean isSsl()
public RequestOptions setSsl(Boolean ssl)
ssl
- true if enabledpublic String getURI()
public RequestOptions setURI(String uri)
uri
- the relative uripublic RequestOptions addHeader(String key, String value)
key
- the header keyvalue
- the header valuepublic RequestOptions setHeaders(MultiMap headers)
headers
- the headerspublic MultiMap getHeaders()
public JsonObject toJson()
Copyright © 2023 Eclipse. All rights reserved.