public static final class OkHTTPClient.RequestBuilder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
OkHTTPClient.RequestBuilder.HTTPRequest
Internal class to manage the request.
|
Constructor and Description |
---|
RequestBuilder(java.lang.String url)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
OkHTTPClient.RequestBuilder |
addFileParam(java.lang.String paramName,
java.io.File file)
Add a file parameter, as the request will be of multipart type.
|
OkHTTPClient.RequestBuilder |
addParam(java.lang.String name,
java.lang.String value)
Add a parameter to the 'POST' request.
|
OkHTTPClient.RequestBuilder |
setEncodeCharsetParams(java.nio.charset.Charset charset)
Set the charset of the parameters.
|
OkHTTPClient.RequestBuilder |
setMethod(java.lang.String method)
Set the method ['GET', 'POST'].
|
OkHTTPClient.RequestBuilder |
setParams(java.util.Map<java.lang.String,java.lang.String> params)
Set the parameters to the 'POST' request.
|
OkHTTPClient.RequestBuilder |
setRequestProperties(java.util.Map<java.lang.String,java.lang.String> requestProperties)
Set the http head request properties.
|
public OkHTTPClient.RequestBuilder setMethod(java.lang.String method)
method
- method request to use.public OkHTTPClient.RequestBuilder addParam(java.lang.String name, java.lang.String value)
name
- name of the parameter.value
- value of the parameter.public OkHTTPClient.RequestBuilder setParams(java.util.Map<java.lang.String,java.lang.String> params)
params
- map with the name and value of the parameters.public OkHTTPClient.RequestBuilder addFileParam(java.lang.String paramName, java.io.File file)
paramName
- the name of the file parameter.file
- the file to be sent.public OkHTTPClient.RequestBuilder setEncodeCharsetParams(java.nio.charset.Charset charset)
charset
- charset.public OkHTTPClient.RequestBuilder setRequestProperties(java.util.Map<java.lang.String,java.lang.String> requestProperties)
requestProperties
- List of pair property and value to specify in the request.