Package feign
Class Request
- java.lang.Object
-
- feign.Request
-
public final class Request extends java.lang.ObjectAn immutable request to an http server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRequest.Bodystatic classRequest.HttpMethodstatic classRequest.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.Charsetcharset()Deprecated.userequestBody()insteadstatic Requestcreate(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 Requestcreate(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 Requestcreate(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.HttpMethodhttpMethod()Http Method for the request.java.lang.Stringmethod()Deprecated.Request.BodyrequestBody()java.lang.StringtoString()java.lang.Stringurl()
-
-
-
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 exceptbodyandcharset. 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:
toStringin classjava.lang.Object
-
-