ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
http_client.h File Reference

Layer 7 - the user agent (RFC 9110 sec 3.5): one outbound HTTP/1.1 message exchange. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

Layer 7 - the user agent (RFC 9110 sec 3.5): one outbound HTTP/1.1 message exchange.

RFC 9110 sec 3.5: "the term 'user agent' refers to any of the various client programs that initiate a request." This is that side of HTTP. The serving side is network_drivers/presentation/http.

The exchange runs in three steps, each a call on ::HttpClient:

  • HttpClientNs::parse_target_uri splits the target URI (RFC 9110 sec 7.1) into the authority it dials and the origin-form request target it sends (RFC 9112 sec 3.2.1).
  • HttpClientNs::build_request writes the request-line and field lines of an HTTP-message (RFC 9112 sec 2.1, sec 3).
  • HttpClientNs::parse_response reads the status-line (RFC 9112 sec 4) and frames the message body by the rules of RFC 9112 sec 6.3.

Those three touch no socket and are unit-tested on the host. HttpClientNs::get and HttpClientNs::post run all three over the shared outbound transport (::TcpClient), with the TLS record layer under them for an https target URI (RFC 9112 sec 9.7).

The content is returned by pointer into the module's receive buffer and is valid until the next call. One exchange at a time: the module holds one connection and one buffer.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file http_client.h.