About HTTPc

Goals

µC/HTTP-client product can be used to access public HTTP servers and perform actions on resources maintained by a server.

In an embedded environment, an HTTP client will rarely be used to display web pages like a web browser does. It will primarily be used to get and update specific values, download and upload files or to interface with public web services.

Design

µC/HTTP-client has been designed to suit many different types of HTTP client applications. With the right configuration it can be used with a very low footprint to send a simple HTTP request and wait for the HTTP server's response. Another benefit of its design is that it can also be used to make simultaneous HTTP requests by opening multiple connections which allows for consistent usage of the same API calls.

Memory Usage

Each HTTP client application can have very different memory needs. For example, some applications will only require one connection whereas others will require more; some applications will prefer to allocate objects on their own Stack while others will want to use a memory pool on the Heap. Therefore, to conform with all of these different requirements, µC/HTTP-client does not have its own memory module. All the objects required by the µC/HTTP-client MUST be passed by the application. Three HTTP Client Objects must be supplied by the Application: a Connection object, a Request Object and a Response Object. Also, a buffer per connection must be supplied for the transmission/reception operations. Additional objects may be required when some available features are enabled.

It is very important that every objects passed by the application to the µC/HTTP-client stack stay valid for the duration of the HTTP transaction or until the connection is closed for the HTTPc Connection Object.

Internal Task

To support multiple simultaneous connections, µC/HTTP-client has an internal task. This task also allows the queuing of multiple requests on a given connection. When the µC/HTTP-client Task is present, API calls to µC/HTTP-client's stack can set to the blocking or non-blocking mode.

For simpler applications and to reduce memory footage, the internal µC/HTTP-client task can be disabled. In that case, µC/HTTP-client operations will be executed directly in the application task and will always be blocking.

Auto Select Remote IP address

When µC/DNSc is present, µC/HTTP-client can accept a host name string to connect to the remote server. It will perform the IP address resolution by communicating with a DNS server. If the DNS server sends back IPv4 and IPv6 addresses, the first attempt will be to use the IPv6 address to connect to the remote HTTP server. If this connection fails the IPv4 address will be used instead.

When µC/DNSc is not present, an IPv4 or IPv6 remote address in string form must be passed to µC/HTTP-client to connect to the remote server.

Scalable Product

With its compile-time configuration, µC/HTTP-client's code footprint can be adjusted to fit the Application requirements by enabling/disabling features.

Features

µC/HTTP-client supports:

  • Persistent connection
  • Form submission
  • Chunked Transfer Encoding for transmission and reception.
  • HTTP Header Field processing.
  • HTTP Query String processing.
  • WebSocket Message Processing.

See the section HTTP Reference Guide for additional details on each feature available.

Limitations

  • Only supports HTTP v1.1.
  • HTTP range requests are not supported.