|
wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
|
Small conveniences for a wired_http_handler filling its exchange. More...
Go to the source code of this file.
Functions | |
| int | wired_http_reply_text (wired_http_exchange *x, u16 status, const char *text) |
| Answer x with a text/plain body: sets status (0 = 200), content_type and appends text to x->body (cut to what fits). | |
| int | wired_http_add_field (wired_http_exchange *x, const char *name, const char *value) |
| Append the response header field name: value to x (first round only). | |
Small conveniences for a wired_http_handler filling its exchange.
| int wired_http_add_field | ( | wired_http_exchange * | x, |
| const char * | name, | ||
| const char * | value ) |
Append the response header field name: value to x (first round only).
Both strings are views and must outlive the round (string literals do).
| x | exchange being answered |
| name | lowercase field name, NUL-terminated |
| value | field value, NUL-terminated |
| int wired_http_reply_text | ( | wired_http_exchange * | x, |
| u16 | status, | ||
| const char * | text ) |
Answer x with a text/plain body: sets status (0 = 200), content_type and appends text to x->body (cut to what fits).
| x | exchange being answered |
| status | response status, 0 for 200 |
| text | NUL-terminated body text |