public static final class LoadUrlParams.Builder
extends java.lang.Object
LoadUrlParams.
Builders are created by invoking LoadUrlParams.newBuilder(String).
Each of the setter methods modifies the state of the builder and returns the same instance.
Builders are not thread-safe and should not be used concurrently from multiple threads
without external synchronization.
| Modifier and Type | Method and Description |
|---|---|
LoadUrlParams.Builder |
addExtraHeader(HttpHeader httpHeader)
Adds an extra HTTP header to the HTTP headers that will be sent to the resource.
|
LoadUrlParams |
build()
Returns a new
LoadUrlParams instance built from the current state of this
builder. |
LoadUrlParams.Builder |
postData(java.lang.String postData)
Deprecated.
as of release 7.29, use one the following methods instead:
uploadData(ByteData)
uploadData(TextData)
uploadData(FormData)
uploadData(MultipartFormData) |
LoadUrlParams.Builder |
uploadData(ByteData data)
Sets the upload data as a sequence of bytes that will be sent to the resource.
|
LoadUrlParams.Builder |
uploadData(FormData data)
Sets the upload data in the
application/x-www-form-urlencoded format that will be
sent to the resource. |
LoadUrlParams.Builder |
uploadData(MultipartFormData data)
Sets the upload data in the
multipart/form-data format that will be sent to the
resource. |
LoadUrlParams.Builder |
uploadData(TextData data)
Sets the upload data in the
text/plain format that will be sent to the resource. |
public LoadUrlParams.Builder postData(java.lang.String postData)
uploadData(ByteData)
uploadData(TextData)
uploadData(FormData)
uploadData(MultipartFormData)When Content-Type in the extra headers is set to
"application/x-www-form-urlencoded", the POST data must be in
the key=value&key=value format.
When Content-Type is set to "text/plain", the POST data string
can be in any plain format.
postData - the POST datapublic LoadUrlParams.Builder uploadData(ByteData data)
The extra headers must include the Content-Type header with the type of the
given sequence of bytes.
data - the upload data as a sequence of bytespublic LoadUrlParams.Builder uploadData(TextData data)
text/plain format that will be sent to the resource.data - the upload data in the text/plain formatpublic LoadUrlParams.Builder uploadData(FormData data)
application/x-www-form-urlencoded format that will be
sent to the resource.data - the upload data in the application/x-www-form-urlencoded formatpublic LoadUrlParams.Builder uploadData(MultipartFormData data)
multipart/form-data format that will be sent to the
resource.data - the upload data in the multipart/form-data formatpublic LoadUrlParams.Builder addExtraHeader(HttpHeader httpHeader)
If you send POST data as a sequence of bytes using uploadData(ByteData), then
you must add the Content-Type HTTP header with the type of the given bytes.
httpHeader - the extra HTTP headerpublic LoadUrlParams build()
LoadUrlParams instance built from the current state of this
builder.LoadUrlParams instance