oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ove::httpd::Request Class Reference

Read-only view of an incoming HTTP request. More...

#include <net_httpd.hpp>

Public Member Functions

 Request (ove_httpd_req_t *raw)
 Constructs a Request view from a raw C request pointer.
 
 Request (const Request &)=delete
 
Requestoperator= (const Request &)=delete
 
 Request (Request &&)=delete
 
Requestoperator= (Request &&)=delete
 
const char * method () const
 Returns the HTTP method string ("GET", "POST", etc.).
 
const char * path () const
 Returns the full request path (e.g. "/api/leds/0").
 
const char * query () const
 Returns the query string after '?' (or NULL).
 
const char * body () const
 Returns the request body (or NULL).
 
size_t body_len () const
 Returns the request body length in bytes.
 
const char * segment (int idx) const
 Returns a path segment by index.
 
ove_httpd_req_t * raw () const
 Returns the raw oveRTOS request pointer.
 

Detailed Description

Read-only view of an incoming HTTP request.

Wraps the opaque ove_httpd_req_t pointer that is passed into route handler callbacks. Does not own the underlying storage; the pointer remains valid for the duration of the handler invocation.

Note
Non-copyable and non-movable (lifetime is bound to the handler call).

Constructor & Destructor Documentation

◆ Request()

ove::httpd::Request::Request ( ove_httpd_req_t *  raw)
inlineexplicit

Constructs a Request view from a raw C request pointer.

Parameters
[in]rawOpaque request handle from the server callback.

Member Function Documentation

◆ segment()

const char * ove::httpd::Request::segment ( int  idx) const
inline

Returns a path segment by index.

For path "/api/leds/0": segment(0)="api", segment(1)="leds", segment(2)="0".

Parameters
[in]idxZero-based segment index.
Returns
Segment string, or NULL if out of range.

◆ raw()

ove_httpd_req_t * ove::httpd::Request::raw ( ) const
inline

Returns the raw oveRTOS request pointer.

Returns
The opaque ove_httpd_req_t pointer.

The documentation for this class was generated from the following file: