Package discord4j.rest.http.client
Class ClientRequest
- java.lang.Object
-
- discord4j.rest.http.client.ClientRequest
-
public class ClientRequest extends Object
An adapted request definition from an originalDiscordWebRequest.
-
-
Constructor Summary
Constructors Constructor Description ClientRequest(DiscordWebRequest request)Create a newClientRequestfrom the given request template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetBody()Return the body to encode while processing this request.StringgetDescription()DiscordWebRequestgetDiscordRequest()Return the original request template.HttpHeadersgetHeaders()Return the headers of this request.StringgetId()Return this request's ID for correlation.HttpMethodgetMethod()Return the HTTP method.RoutegetRoute()Return the API endpoint targeted by this request.StringgetUrl()Return the request URL.StringtoString()
-
-
-
Constructor Detail
-
ClientRequest
public ClientRequest(DiscordWebRequest request)
Create a newClientRequestfrom the given request template.- Parameters:
request- theDiscordWebRequesttemplate
-
-
Method Detail
-
getId
public String getId()
Return this request's ID for correlation.- Returns:
- this request's ID
-
getMethod
public HttpMethod getMethod()
Return the HTTP method.- Returns:
- the
HttpMethodof thisClientRequest
-
getUrl
public String getUrl()
Return the request URL.- Returns:
- the request URL for this
ClientRequest
-
getHeaders
public HttpHeaders getHeaders()
Return the headers of this request.- Returns:
- the
HttpHeadersof thisClientRequest
-
getBody
@Nullable public Object getBody()
Return the body to encode while processing this request.- Returns:
- the request body, can be
null
-
getDiscordRequest
public DiscordWebRequest getDiscordRequest()
Return the original request template.- Returns:
- the
DiscordWebRequesttemplate that created thisClientRequest
-
getRoute
public Route getRoute()
Return the API endpoint targeted by this request.- Returns:
- the
Routerequested by thisClientRequest
-
getDescription
public String getDescription()
-
-