HTTP_RESPONSE_ADD_HEADER(3)

NAME
http_response_add_header - adds a HTTP/1.1 header to a response

SYNOPSIS

#include <slweb/http.h>

int http_response_add_header(struct http_response *r, const char *header, const char *value);

DESCRIPTION
The http_response_add_header() function updates a struct http_response object pointed to by r by adding a new HTTP response to it, defined by header and value, which are null-terminated strings defining the key and value for the HTTP header, respectively.

RETURN VALUE
On success, zero is returned. If a fatal error ocurrs, a negative integer is returned, and errno might be set by the internal calls to realloc(3) or strdup(3).

ERRORS
Refer to realloc(3) and strdup(3) for a list of possible errors.

SEE ALSO
slweb_http(7).

COPYRIGHT
Copyright (C) 2023 Xavier Del Campo Romero.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.