Skip to main content

HTTP Client

The HTTP Client feature lets your device call web services and REST APIs. Requests are made with the HTTP Request block. The feature provides the shared request queue and connection handling behind it.

The client is asynchronous: a request is queued and the application keeps running, and the block's outputs run when data arrives, when the request completes, or when it fails.

Availability

The HTTP Client requires a network interface (Ethernet, Wi-Fi or Cellular).

Configuration​

  • HTTP Client Enabled: turns the client on. The other properties are hidden while it is off.
  • Max Requests: how many requests can be queued at the same time. Defaults to 5. Requests made while the queue is full are dropped until a slot frees up.
  • Debug Print: prints request and response details to the debug console, which helps when troubleshooting a request.

You usually don't need to enable the feature by hand. Adding an HTTP Request block to the canvas enables it, along with the socket and DNS libraries it depends on.

HTTPS​

On Zephyr-based devices, a request whose URL starts with https, or whose URL comes from a variable, automatically adds the MbedTLS library to the project for TLS.

Supported Methods​

The HTTP Request block supports GET, HEAD, POST, PUT, DELETE, and PATCH.

See Also​