Package feign
Class Request
- java.lang.Object
-
- feign.Request
-
public final class Request extends java.lang.Object
An immutable request to an http server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Request.Body
static class
Request.HttpMethod
static class
Request.Options
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description byte[]
body()
Deprecated.userequestBody()
insteadjava.nio.charset.Charset
charset()
Deprecated.userequestBody()
insteadstatic Request
create(Request.HttpMethod httpMethod, java.lang.String url, java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> headers, byte[] body, java.nio.charset.Charset charset)
Builds a Request.static Request
create(Request.HttpMethod httpMethod, java.lang.String url, java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> headers, Request.Body body)
Builds a Request.static Request
create(java.lang.String method, java.lang.String url, java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> headers, byte[] body, java.nio.charset.Charset charset)
Deprecated.java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>
headers()
Request.HttpMethod
httpMethod()
Http Method for the request.java.lang.String
method()
Deprecated.Request.Body
requestBody()
java.lang.String
toString()
java.lang.String
url()
-
-
-
Method Detail
-
create
public static Request create(java.lang.String method, java.lang.String url, java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> headers, byte[] body, java.nio.charset.Charset charset)
Deprecated.No parameters can be null exceptbody
andcharset
. All parameters must be effectively immutable, via safe copies, not mutating or otherwise.
-
create
public static Request create(Request.HttpMethod httpMethod, java.lang.String url, java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> headers, byte[] body, java.nio.charset.Charset charset)
Builds a Request. All parameters must be effectively immutable, via safe copies.- Parameters:
httpMethod
- for the request.url
- for the request.headers
- to include.body
- of the request, can be nullcharset
- of the request, can be null- Returns:
- a Request
-
create
public static Request create(Request.HttpMethod httpMethod, java.lang.String url, java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> headers, Request.Body body)
Builds a Request. All parameters must be effectively immutable, via safe copies.- Parameters:
httpMethod
- for the request.url
- for the request.headers
- to include.body
- of the request, can be null- Returns:
- a Request
-
method
public java.lang.String method()
Deprecated.Http Method for this request.- Returns:
- the HttpMethod string
-
httpMethod
public Request.HttpMethod httpMethod()
Http Method for the request.- Returns:
- the HttpMethod.
-
url
public java.lang.String url()
-
headers
public java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> headers()
-
charset
public java.nio.charset.Charset charset()
Deprecated.userequestBody()
insteadThe character set with which the body is encoded, or null if unknown or not applicable. When this is present, you can usenew String(req.body(), req.charset())
to access the body as a String.
-
body
public byte[] body()
Deprecated.userequestBody()
insteadIf present, this is the replayable body to send to the server. In some cases, this may be interpretable as text.- See Also:
charset()
-
requestBody
public Request.Body requestBody()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-