summary refs log tree commit diff
path: root/man/libhttpc_dumpresponse.3
blob: 81074ec312d502b8e96e6f47c87219c60e2488fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.Dd December 14, 2024
.Dt LIBHTTPC_DUMPRESPONSE 3
.Os
.
.Sh NAME
.Nm LibHTTPC_dumpResponse ,
.Nm LibHTTPC_writeResponse
.Nd save
.Xr libhttpc_response 3
.
.Sh SYNOPSIS
.In libhttpc/libhttpc.h
.Ft "char *"
.Fo LibHTTPC_dumpResponse
.Fa "struct LibHTTPC_Response *response"
.Fa "char *buf"
.Fa "size_t buf_len"
.Fc
.Ft int
.Fo "LibHTTPC_writeResponse"
.Fa "int sockfd"
.Fa "struct LibHTTPC_Response *response"
.Fc
.
.Sh DESCRIPTION
.Fn LibHTTPC_dumpResponse
combines
contents of
.Fa response
in the
.Fa buf .
.
.Pp
.Fn LibHTTPC_writeResponse
writes the
.Fa response
to the
.Fa sockfd .
.
.Pp
Both functions can
autocomplete responses.
If
.Fa response->version
is
.Dv NULL ,
then it will
be set to
.Ql "HTTP/1.1" .
If
.Fa response->status
is 0,
then it will
be set to
200.
If
.Fa response->phrase
is
.Dv NULL ,
then it will
be set to
.Fn LibHTTPC_dumpStatus status .
.
.Sh RETURN VALUES
.Fn LibHTTPC_writeResponse
will return 1
if cannot send
response.
Read
.Ql ERRORS
section of
.Xr send 2
for more information.
.
.Sh SEE ALSO
.Xr libhttpc 3 ,
.Xr libhttpc_header 3 ,
.Xr libhttpc_status 3 ,
.Xr libhttpc_response 3
.
.Sh AUTHORS
.An Nakidai Perumenei Aq Mt nakidai@disroot.org
.
.Sh CAVEATS
.Nm
may edit fields of
.Ql response
that are set to
0