Modifier and Type | Class and Description |
---|---|
static class |
Request.Builder |
Constructor and Description |
---|
Request(String httpMethod,
String url,
Map<String,List<String>> headers,
byte[] dataToSend,
Localization localization,
boolean automaticLocalizationHeader) |
Modifier and Type | Method and Description |
---|---|
byte[] |
dataToSend()
An optional byte array that will be sent when doing the request, very commonly used in
POST requests.The implementation should make note of some recommended headers (for example, Content-Length in a post request). |
boolean |
equals(Object o) |
int |
hashCode() |
Map<String,List<String>> |
headers()
A list of headers that will be used in the request.
Any default headers that the implementation may have, should be overridden by these. |
static Map<String,List<String>> |
headersFromLocalization(Localization localization) |
String |
httpMethod()
A http method (i.e.
|
Localization |
localization()
A localization object that should be used when executing a request.
Usually the Accept-Language will be set to this value (a helper
method to do this easily: headersFromLocalization(Localization) ). |
static Request.Builder |
newBuilder() |
String |
url()
The URL that is pointing to the wanted resource.
|
public String httpMethod()
GET, POST, HEAD
).public String url()
public Map<String,List<String>> headers()
@Nullable public byte[] dataToSend()
POST
requests.Content-Length
in a post request).@Nullable public Localization localization()
Accept-Language
will be set to this value (a helper
method to do this easily: headersFromLocalization(Localization)
).public static Request.Builder newBuilder()
@Nonnull public static Map<String,List<String>> headersFromLocalization(@Nullable Localization localization)