FastLED 3.10.6
Loading...
Searching...
No Matches

◆ build_http_request()

bool fl::net::http::detail::build_http_request ( const RequestOptions & options,
const fl::string & path,
const fl::string & host,
fl::string * out )

The HTTP/1.1 request FetchRequest sends: options.method (GET when empty) on the request line, Host, the caller's headers, Content-Length for a non-empty body, Connection: close, then the body.

The caller's Host, Connection, Content-Length and Transfer-Encoding are dropped: FetchRequest owns those, and a second copy would duplicate or contradict the framing.

Returns false, leaving out untouched, when the method, path, host or any header name or value contains CR or LF: those would let a caller inject request lines or headers (CWE-93).

References fl::FL_NO_EXCEPT.