diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-09-27 01:09:04 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-09-27 21:55:58 +0200 |
| commit | adb0973bb355b9f7eb27d9842116e43c7f77d261 (patch) | |
| tree | 295eba8a1f2fde6e6d500fbe7b32ac5330d0bbbe /doc/man3/http_response_add_header.3 | |
| parent | 0d54bbf08674174c1e7b91ce39984c29b78cf0ba (diff) | |
| download | libweb-adb0973bb355b9f7eb27d9842116e43c7f77d261.tar.gz | |
Add man pages
Diffstat (limited to 'doc/man3/http_response_add_header.3')
| -rw-r--r-- | doc/man3/http_response_add_header.3 | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/doc/man3/http_response_add_header.3 b/doc/man3/http_response_add_header.3 new file mode 100644 index 0000000..4f033ea --- /dev/null +++ b/doc/man3/http_response_add_header.3 @@ -0,0 +1,53 @@ +.TH HTTP_RESPONSE_ADD_HEADER 3 2023-09-07 0.1.0 "slweb Library Reference" + +.SH NAME +http_response_add_header \- adds a HTTP/1.1 header to a response + +.SH SYNOPSIS +.LP +.nf +#include <slweb/http.h> +.P +int http_response_add_header(struct http_response *\fIr\fP, const char *\fIheader\fP, const char *\fIvalue\fP); +.fi + +.SH DESCRIPTION +The +.IR http_response_add_header () +function updates a +.I "struct http_response" +object pointed to by +.IR r +by adding a new HTTP response to it, defined by +.I header +and +.IR value , +which are null-terminated strings defining the key +and value for the HTTP header, respectively. + +.SH RETURN VALUE +On success, zero is returned. If a fatal error ocurrs, a negative +integer is returned, and +.I errno +might be set by the internal calls to +.IR realloc (3) +or +.IR strdup (3). + +.SH ERRORS +Refer to +.IR realloc (3) +and +.IR strdup (3) +for a list of possible errors. + +.SH SEE ALSO +.BR slweb_http (7). + +.SH COPYRIGHT +Copyright (C) 2023 Xavier Del Campo Romero. +.P +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. |
