This page is part of archived documentation for openHAB 4.3. Go to the current stable version
# HTTP
# Introduction
This section explains the blocks that allow sending HTTP requests.
# HTTP Requests
There is one block that handles all type of requests. Depending on the required functionality it changes its design.
# Option Toggles
There are two toggle buttons that allow the block to be small for simple requests and add further options to be used:
- Clock: enables the timeout option
- H: enables the header option and allows to provide headers during the request via a Dictionary
# HTTP Request GET
Function: Send an HTTP GET request to a server and receive the response
The simplest form is shown by default and accepts the destination URI as String.
By activating the toggles the timeout and request headers can be provided. See the POST-Request below for an example showing these additional fields.
# HTTP Request POST
Function: Send an HTTP POST request to a server and receive the response
The simplest form is shown by default and accepts the destination URI as String and in comparison to the GET-Request adds a section for the payload which takes two parameters:
- the MIME-type of the content to be sent
- the content to be sent to the destination
Here is a more complex example that additionally sets a header and the timeout:
# HTTP Request PUT
Function: Send an HTTP PUT request to a server and receive the response
The simplest form is shown by default and accepts the destination URI as String and is similar in functionality to the POST-Request:
- the MIME-type of the content to be sent
- the content to be sent to the destination
# HTTP Request DELETE
Function: Send an HTTP DELETE request to a server and receive the response
The simplest form is shown by default and accepts the destination URI as String.