BSB Developer Docs
Loading...
Searching...
No Matches
http_headers.h
Go to the documentation of this file.
1
4#pragma once
5
6#include <core/string.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
15typedef struct HttpHeader {
16 FuriString* key;
17 FuriString* value;
19
23typedef struct HttpHeaders HttpHeaders;
24
31
37void http_headers_free(HttpHeaders* instance);
38
48bool http_headers_parse(HttpHeaders* instance, const char* data, size_t data_len);
49
57size_t http_headers_get_count(const HttpHeaders* instance);
58
71const HttpHeader* http_headers_get_by_index(const HttpHeaders* instance, size_t index);
72
87const HttpHeader* http_headers_get(const HttpHeaders* instance, const char* key);
88
102void http_headers_set(HttpHeaders* instance, const char* key, const char* value);
103
104#ifdef __cplusplus
105}
106#endif
size_t http_headers_get_count(const HttpHeaders *instance)
Get the number of header elements held in the instance.
Definition http_headers.c:141
HttpHeaders * http_headers_alloc(void)
Create an empty HttpHeaders instance.
Definition http_headers.c:122
bool http_headers_parse(HttpHeaders *instance, const char *data, size_t data_len)
Parse the HTTP headers from a string.
Definition http_headers.c:134
void http_headers_set(HttpHeaders *instance, const char *key, const char *value)
Set the header element under the string key.
Definition http_headers.c:158
const HttpHeader * http_headers_get_by_index(const HttpHeaders *instance, size_t index)
Get the header element by its index.
Definition http_headers.c:146
struct HttpHeader HttpHeader
Single HTTP header structure (key: value).
const HttpHeader * http_headers_get(const HttpHeaders *instance, const char *key)
Get the header element by its string key.
Definition http_headers.c:152
void http_headers_free(HttpHeaders *instance)
Delete the HttpHeaders instance.
Definition http_headers.c:128
Single HTTP header structure (key: value).
Definition http_headers.h:15
FuriString * value
Header value (e.g.
Definition http_headers.h:17
FuriString * key
Header key (e.g.
Definition http_headers.h:16
Definition http_headers.c:11