![]() |
BSB Developer Docs
|
Utility functions for parsing HTTP responses. More...
Go to the source code of this file.
Data Structures | |
| struct | HttpResponse |
| Parsed HTTP response structure. More... | |
Functions | |
| void | http_response_init (HttpResponse *instance) |
| Initialise a HttpResponse instance with default values. | |
| bool | http_response_parse (HttpResponse *instance, const char *data, size_t data_len) |
| Parse the response from a raw string representation. | |
Utility functions for parsing HTTP responses.
| void http_response_init | ( | HttpResponse * | instance | ) |
Initialise a HttpResponse instance with default values.
After calling this function, all string slices are guaranteed to be zero-length and with non-NULL pointers.
| [in,out] | instance | pointer to the instance to be initialised |
| bool http_response_parse | ( | HttpResponse * | instance, |
| const char * | data, | ||
| size_t | data_len ) |
Parse the response from a raw string representation.
instance is left untouched. Therefore, if a valid value is needed at all times, http_response_init must be called first to ensure that the instance is valid before calling this function.| [in,out] | instance | pointer to the instance to be parsed |
| [in] | data | pointer to the source string (does NOT need to be zero-terminated) |
| [in] | data_len | length of the source string in bytes |