public class HttpsRequest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected HttpsConnection |
connection
The underlying HTTPS connection stream.
|
| Modifier | Constructor and Description |
|---|---|
protected |
HttpsRequest() |
|
HttpsRequest(URL url,
HttpsMethod method,
byte[] body)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
HttpsResponse |
send()
Executes the HTTPS request.
|
HttpsRequest |
setHeaderField(String field,
String value)
Sets the header field to the given value.
|
HttpsRequest |
setReadTimeoutMillis(int timeout)
Sets the read timeout, in milliseconds, for the request.
|
protected final HttpsConnection connection
public HttpsRequest(URL url, HttpsMethod method, byte[] body) throws IOException
url - the URL for the request.method - the HTTPS request method (i.e. GET).body - the request body. Must be an array of size 0 if the request
method is GET or DELETE.IOException - if an IOException occurs in setting up the HTTPS
connection.IllegalArgumentException - if the endpoint given does not use the
HTTPS protocol.protected HttpsRequest()
public HttpsResponse send() throws IOException
IOException - if the connection could not be established, or the
input/output streams could not be accessed.public HttpsRequest setHeaderField(String field, String value)
field - the header field name.value - the header field value.public HttpsRequest setReadTimeoutMillis(int timeout)
timeout - the read timeout.Copyright © 2017. All rights reserved.