HttpsRequest Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. transport. https. HttpsRequest
- com.
public class HttpsRequest
An HTTPS request.
Constructor Summary
Modifier | Constructor | Description | |
---|---|---|---|
protected | HttpsRequest() | ||
HttpsRequest(URL url, HttpsMethod method, byte[] body, String userAgentString) |
Constructor. |
||
HttpsRequest(URL url, HttpsMethod method, byte[] body, String userAgentString, ProxySettings proxySettings) |
Constructor. |
Method Summary
Modifier and Type | Method and Description |
---|---|
byte[] | getBody() |
java.lang.String | getHttpMethod() |
java.lang.String | getRequestHeaders() |
java.net.URL | getRequestUrl() |
Https |
send()
Executes the HTTPS request. |
Https |
sendAsHttpRequest()
Executes the HTTPS request as an HTTP request. |
Https |
setConnectTimeout(int timeout)
Sets the connect timeout, in milliseconds, for the request. |
Https |
setHeaderField(String field, String value)
Sets the header field to the given value. |
Https |
setReadTimeout(int timeout)
Sets the read timeout, in milliseconds, for the request. |
Https |
setSSLContext(SSLContext sslContext)
Sets this object's SSL context |
Methods inherited from java.lang.Object
Constructor Details
HttpsRequest
protected HttpsRequest()
HttpsRequest
public HttpsRequest(URL url, HttpsMethod method, byte[] body, String userAgentString)
Constructor. Takes a URL as an argument and returns an HTTPS request that is ready to be sent.
Parameters:
HttpsRequest
public HttpsRequest(URL url, HttpsMethod method, byte[] body, String userAgentString, ProxySettings proxySettings)
Constructor. Takes a URL as an argument and returns an HTTPS request that is ready to be sent.
Parameters:
Method Details
getBody
public byte[] getBody()
getHttpMethod
public String getHttpMethod()
getRequestHeaders
public String getRequestHeaders()
getRequestUrl
public URL getRequestUrl()
send
public HttpsResponse send()
Executes the HTTPS request.
Returns:
Throws:
sendAsHttpRequest
public HttpsResponse sendAsHttpRequest()
Executes the HTTPS request as an HTTP request. This method should only be called when a user supplied url contains HTTP rather than HTTPS. Currently, this only happens from the HttpsHsmClient for some edge workload urls.
Returns:
Throws:
setConnectTimeout
public HttpsRequest setConnectTimeout(int timeout)
Sets the connect timeout, in milliseconds, for the request.
Parameters:
Returns:
setHeaderField
public HttpsRequest setHeaderField(String field, String value)
Sets the header field to the given value.
Parameters:
Returns:
setReadTimeout
public HttpsRequest setReadTimeout(int timeout)
Sets the read timeout, in milliseconds, for the request. The read timeout is the number of milliseconds after the server receives a request and before the server sends data back.
Parameters:
Returns:
setSSLContext
public HttpsRequest setSSLContext(SSLContext sslContext)
Sets this object's SSL context
Parameters:
Returns:
Throws:
Applies to
Azure SDK for Java