|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
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 | |
| Request & | operator= (const Request &)=delete |
| Request (Request &&)=delete | |
| Request & | operator= (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. | |
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.
|
inlineexplicit |
Constructs a Request view from a raw C request pointer.
| [in] | raw | Opaque request handle from the server callback. |
|
inline |
Returns a path segment by index.
For path "/api/leds/0": segment(0)="api", segment(1)="leds", segment(2)="0".
| [in] | idx | Zero-based segment index. |
|
inline |
Returns the raw oveRTOS request pointer.
ove_httpd_req_t pointer.