public final class Request extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Request.Body
Request Body
|
static class |
Request.HttpMethod |
static class |
Request.Options
Controls the per-request settings currently required to be implemented by all
clients |
static class |
Request.ProtocolVersion |
Modifier and Type | Method and Description |
---|---|
byte[] |
body()
If present, this is the replayable body to send to the server.
|
Charset |
charset()
Charset of the request.
|
static Request |
create(Request.HttpMethod httpMethod,
String url,
Map<String,Collection<String>> headers,
byte[] body,
Charset charset)
Deprecated.
|
static Request |
create(Request.HttpMethod httpMethod,
String url,
Map<String,Collection<String>> headers,
byte[] body,
Charset charset,
RequestTemplate requestTemplate)
Builds a Request.
|
static Request |
create(Request.HttpMethod httpMethod,
String url,
Map<String,Collection<String>> headers,
Request.Body body,
RequestTemplate requestTemplate)
Builds a Request.
|
static Request |
create(String method,
String url,
Map<String,Collection<String>> headers,
byte[] body,
Charset charset)
Deprecated.
|
void |
header(String key,
Collection<String> values)
Add new entries to request Headers.
|
void |
header(String key,
String value)
Add new entries to request Headers.
|
Map<String,Collection<String>> |
headers()
Request Headers.
|
Request.HttpMethod |
httpMethod()
Http Method for the request.
|
boolean |
isBinary() |
int |
length()
Request Length.
|
String |
method()
Deprecated.
@see
httpMethod() |
Request.ProtocolVersion |
protocolVersion()
Request HTTP protocol version
|
RequestTemplate |
requestTemplate() |
String |
toString()
Request as an HTTP/1.1 request.
|
String |
url()
URL for the request.
|
@Deprecated public static Request create(String method, String url, Map<String,Collection<String>> headers, byte[] body, Charset charset)
create(HttpMethod, String, Map, byte[], Charset)
body
and charset
. All parameters must be
effectively immutable, via safe copies, not mutating or otherwise.@Deprecated public static Request create(Request.HttpMethod httpMethod, String url, Map<String,Collection<String>> headers, byte[] body, Charset charset)
httpMethod
- for the request.url
- for the request.headers
- to include.body
- of the request, can be nullcharset
- of the request, can be nullpublic static Request create(Request.HttpMethod httpMethod, String url, Map<String,Collection<String>> headers, byte[] body, Charset charset, RequestTemplate requestTemplate)
httpMethod
- for the request.url
- for the request.headers
- to include.body
- of the request, can be nullcharset
- of the request, can be nullpublic static Request create(Request.HttpMethod httpMethod, String url, Map<String,Collection<String>> headers, Request.Body body, RequestTemplate requestTemplate)
httpMethod
- for the request.url
- for the request.headers
- to include.body
- of the request, can be null@Deprecated public String method()
httpMethod()
public Request.HttpMethod httpMethod()
public String url()
public Map<String,Collection<String>> headers()
public void header(String key, String value)
key
- value
- public void header(String key, Collection<String> values)
key
- values
- public Charset charset()
public byte[] body()
charset()
public boolean isBinary()
public int length()
public Request.ProtocolVersion protocolVersion()
public String toString()
@Experimental public RequestTemplate requestTemplate()
Copyright © 2012–2023 OpenFeign. All rights reserved.