public class Net.Builder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
contentType |
java.util.List<Net.Header> |
headers |
byte[] |
payloadBytes |
java.lang.String |
payloadString |
java.lang.String |
url |
Modifier and Type | Method and Description |
---|---|
Net.Builder |
addHeader(java.lang.String name,
java.lang.String value)
Adds the supplied request header.
|
java.lang.String |
contentType() |
RFuture<Net.Response> |
execute()
Executes this request, delivering the response via
callback . |
boolean |
isPost() |
java.lang.String |
method() |
Net.Builder |
setPayload(byte[] payload)
Configures the payload of this request as raw bytes with content type
"application/octet-stream".
|
Net.Builder |
setPayload(byte[] payload,
java.lang.String contentType)
Configures the payload of this request as raw bytes with the specified content type.
|
Net.Builder |
setPayload(java.lang.String payload)
Configures the payload of this request as a UTF-8 string with content type "text/plain".
|
Net.Builder |
setPayload(java.lang.String payload,
java.lang.String contentType)
Configures the payload of this request as a UTF-8 string with content type configured as
"
contentType ; charset=UTF-8". |
public final java.lang.String url
public final java.util.List<Net.Header> headers
public java.lang.String contentType
public java.lang.String payloadString
public byte[] payloadBytes
public Net.Builder setPayload(java.lang.String payload)
public Net.Builder setPayload(java.lang.String payload, java.lang.String contentType)
contentType
; charset=UTF-8". The supplied content type should probably be something
like text/plain
or text/xml
or application/json
. This converts the
request to a POST.public Net.Builder setPayload(byte[] payload)
public Net.Builder setPayload(byte[] payload, java.lang.String contentType)
public Net.Builder addHeader(java.lang.String name, java.lang.String value)
name
- the name of the header (e.g. Authorization
).value
- the value of the header.public RFuture<Net.Response> execute()
callback
.public boolean isPost()
public java.lang.String method()
public java.lang.String contentType()
Copyright © 2019. All Rights Reserved.