The HTTP/2 functions are used to exchange data over HTTP/2 as a client. However, the functions can also be used for HTTP/1.
...
Parameter | Description | |||||||
---|---|---|---|---|---|---|---|---|
| The name or IP address of the HTTP server. | |||||||
path | The path.
| |||||||
protocol | The protocol used: HTTP/1 or HTTP/2. The default value is HTTP/1. To use HTTP/2, you must set this value to "h2". | |||||||
port | The port number to contact the HTTP server on. Port 80 is used for HTTP connection and 443 is used for HTTPS connection by default. | |||||||
secure | Indicates whether the data should be sent in secure mode or not. | |||||||
| The number of milliseconds to wait for a response. If the value is not specifically specified, the default timeout is used. The default value is 15000 milliseconds. | |||||||
| The number of milliseconds to wait for a connection to be established. If the value is not specifically specified, the default timeout is used. The default value is 3000 milliseconds. | |||||||
| A username for an account on the HTTP server. | |||||||
| Password associated with the username. | |||||||
headers | Custom HTTP request headers. | |||||||
Returns | Content from A response from the HTTP server. It will be be |
...
Parameter | Description | |||||||
---|---|---|---|---|---|---|---|---|
| The name or IP address of the HTTP server. | |||||||
| The path
| |||||||
bytarray | The body of the request in bytearray format. | |||||||
| The MIME type of the content.
| |||||||
| The protocol used: HTTP/1 or HTTP/2. The default value is HTTP/1. To use HTTP/2, you must set this value to "h2". | |||||||
| The port number to contact the HTTP server on. Port 80 is used for HTTP connection and 443 is used for HTTPS connection by default. | |||||||
secure | Indicates whether the data should be sent in secure mode or not. | |||||||
| The number of milliseconds to wait for a response. If the value is not specifically specified, the default timeout is used. The default value is 15000 milliseconds. | |||||||
| The number of milliseconds to wait for a connection to be established. If the value is not specifically specified, the default timeout is used. The default value is 3000 milliseconds. | |||||||
| A username for an account on the HTTP server. | |||||||
| Password associated with the username. | |||||||
headers | Custom HTTP request headers. | |||||||
Returns | Content from A response from the HTTP server. It will be be |
...
Parameter | Description |
---|---|
| The name or IP address of the HTTP server. |
| The path on the server to which we should do the POST. |
content | The body of the the request. |
protocol | The protocol used: HTTP/1 or HTTP/2. The default value is HTTP/1. To use HTTP/2, you must set this value to "h2". |
port | The port to be used for the HTTP server. Port 80 is used for HTTP connection and 443 is used for HTTPS connection by default. |
secure | Indicates whether the data should be sent in secure mode or not. |
requestTimeout | The number of milliseconds to wait for a response. If the value is not specifically specified, the default timeout is used. The default value is 15000 milliseconds. |
connectionTimeout | The number of milliseconds to wait for a connection to be established. If the value is not specifically specified, the default timeout is used. The default value is 3000 milliseconds. |
username | Username for the account to be used on the HTTP server. |
password | Password associated with the username. |
headers | Custom HTTP request headers. |
Returns | A bytearray from response from the HTTP server. It will be null if any part of the communication fails. |
...
If you do not set these two properties, the Java Default Truststore is used.
Scroll pagebreak