http_client.h
Go to the documentation of this file.
1 /**
2  * @file http_client.h
3  * @brief HTTP client (HyperText Transfer Protocol)
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _HTTP_CLIENT_H
32 #define _HTTP_CLIENT_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "http/http_common.h"
37 
38 //HTTP client support
39 #ifndef HTTP_CLIENT_SUPPORT
40  #define HTTP_CLIENT_SUPPORT ENABLED
41 #elif (HTTP_CLIENT_SUPPORT != ENABLED && HTTP_CLIENT_SUPPORT != DISABLED)
42  #error HTTP_CLIENT_SUPPORT parameter is not valid
43 #endif
44 
45 //HTTP over TLS
46 #ifndef HTTP_CLIENT_TLS_SUPPORT
47  #define HTTP_CLIENT_TLS_SUPPORT DISABLED
48 #elif (HTTP_CLIENT_TLS_SUPPORT != ENABLED && HTTP_CLIENT_TLS_SUPPORT != DISABLED)
49  #error HTTP_CLIENT_TLS_SUPPORT parameter is not valid
50 #endif
51 
52 //Basic access authentication support
53 #ifndef HTTP_CLIENT_BASIC_AUTH_SUPPORT
54  #define HTTP_CLIENT_BASIC_AUTH_SUPPORT DISABLED
55 #elif (HTTP_CLIENT_BASIC_AUTH_SUPPORT != ENABLED && HTTP_CLIENT_BASIC_AUTH_SUPPORT != DISABLED)
56  #error HTTP_CLIENT_BASIC_AUTH_SUPPORT parameter is not valid
57 #endif
58 
59 //Digest access authentication support
60 #ifndef HTTP_CLIENT_DIGEST_AUTH_SUPPORT
61  #define HTTP_CLIENT_DIGEST_AUTH_SUPPORT DISABLED
62 #elif (HTTP_CLIENT_DIGEST_AUTH_SUPPORT != ENABLED && HTTP_CLIENT_DIGEST_AUTH_SUPPORT != DISABLED)
63  #error HTTP_CLIENT_DIGEST_AUTH_SUPPORT parameter is not valid
64 #endif
65 
66 //MD5 digest support
67 #ifndef HTTP_CLIENT_MD5_SUPPORT
68  #define HTTP_CLIENT_MD5_SUPPORT ENABLED
69 #elif (HTTP_CLIENT_MD5_SUPPORT != ENABLED && HTTP_CLIENT_MD5_SUPPORT != DISABLED)
70  #error HTTP_CLIENT_MD5_SUPPORT parameter is not valid
71 #endif
72 
73 //SHA-256 digest support
74 #ifndef HTTP_CLIENT_SHA256_SUPPORT
75  #define HTTP_CLIENT_SHA256_SUPPORT DISABLED
76 #elif (HTTP_CLIENT_SHA256_SUPPORT != ENABLED && HTTP_CLIENT_SHA256_SUPPORT != DISABLED)
77  #error HTTP_CLIENT_SHA256_SUPPORT parameter is not valid
78 #endif
79 
80 //SHA-512/256 digest support
81 #ifndef HTTP_CLIENT_SHA512_256_SUPPORT
82  #define HTTP_CLIENT_SHA512_256_SUPPORT DISABLED
83 #elif (HTTP_CLIENT_SHA512_256_SUPPORT != ENABLED && HTTP_CLIENT_SHA512_256_SUPPORT != DISABLED)
84  #error HTTP_CLIENT_SHA512_256_SUPPORT parameter is not valid
85 #endif
86 
87 //Default timeout
88 #ifndef HTTP_CLIENT_DEFAULT_TIMEOUT
89  #define HTTP_CLIENT_DEFAULT_TIMEOUT 20000
90 #elif (HTTP_CLIENT_DEFAULT_TIMEOUT < 1000)
91  #error HTTP_CLIENT_DEFAULT_TIMEOUT parameter is not valid
92 #endif
93 
94 //Size of the buffer for input/output operations
95 #ifndef HTTP_CLIENT_BUFFER_SIZE
96  #define HTTP_CLIENT_BUFFER_SIZE 2048
97 #elif (HTTP_CLIENT_BUFFER_SIZE < 256)
98  #error HTTP_CLIENT_BUFFER_SIZE parameter is not valid
99 #endif
100 
101 //TX buffer size for TLS connections
102 #ifndef HTTP_CLIENT_TLS_TX_BUFFER_SIZE
103  #define HTTP_CLIENT_TLS_TX_BUFFER_SIZE 2048
104 #elif (HTTP_CLIENT_TLS_TX_BUFFER_SIZE < 512)
105  #error HTTP_CLIENT_TLS_TX_BUFFER_SIZE parameter is not valid
106 #endif
107 
108 //RX buffer size for TLS connections
109 #ifndef HTTP_CLIENT_TLS_RX_BUFFER_SIZE
110  #define HTTP_CLIENT_TLS_RX_BUFFER_SIZE 16384
111 #elif (HTTP_CLIENT_TLS_RX_BUFFER_SIZE < 512)
112  #error HTTP_CLIENT_TLS_RX_BUFFER_SIZE parameter is not valid
113 #endif
114 
115 //Maximum length of HTTP method
116 #ifndef HTTP_CLIENT_MAX_METHOD_LEN
117  #define HTTP_CLIENT_MAX_METHOD_LEN 8
118 #elif (HTTP_CLIENT_MAX_METHOD_LEN < 1)
119  #error HTTP_CLIENT_MAX_METHOD_LEN parameter is not valid
120 #endif
121 
122 //Maximum length of the user name
123 #ifndef HTTP_CLIENT_MAX_USERNAME_LEN
124  #define HTTP_CLIENT_MAX_USERNAME_LEN 32
125 #elif (HTTP_CLIENT_MAX_USERNAME_LEN < 0)
126  #error HTTP_CLIENT_MAX_USERNAME_LEN parameter is not valid
127 #endif
128 
129 //Maximum length of the password
130 #ifndef HTTP_CLIENT_MAX_PASSWORD_LEN
131  #define HTTP_CLIENT_MAX_PASSWORD_LEN 32
132 #elif (HTTP_CLIENT_MAX_PASSWORD_LEN < 0)
133  #error HTTP_CLIENT_MAX_PASSWORD_LEN parameter is not valid
134 #endif
135 
136 //Maximum length of the realm
137 #ifndef HTTP_CLIENT_MAX_REALM_LEN
138  #define HTTP_CLIENT_MAX_REALM_LEN 32
139 #elif (HTTP_CLIENT_MAX_REALM_LEN < 1)
140  #error HTTP_CLIENT_MAX_REALM_LEN parameter is not valid
141 #endif
142 
143 //Maximum length of the nonce
144 #ifndef HTTP_CLIENT_MAX_NONCE_LEN
145  #define HTTP_CLIENT_MAX_NONCE_LEN 64
146 #elif (HTTP_CLIENT_MAX_NONCE_LEN < 1)
147  #error HTTP_CLIENT_MAX_NONCE_LEN parameter is not valid
148 #endif
149 
150 //Cnonce size
151 #ifndef HTTP_CLIENT_CNONCE_SIZE
152  #define HTTP_CLIENT_CNONCE_SIZE 16
153 #elif (HTTP_CLIENT_CNONCE_SIZE < 1)
154  #error HTTP_CLIENT_CNONCE_SIZE parameter is not valid
155 #endif
156 
157 //Maximum length of the opaque parameter
158 #ifndef HTTP_CLIENT_MAX_OPAQUE_LEN
159  #define HTTP_CLIENT_MAX_OPAQUE_LEN 64
160 #elif (HTTP_CLIENT_MAX_OPAQUE_LEN < 1)
161  #error HTTP_CLIENT_MAX_OPAQUE_LEN parameter is not valid
162 #endif
163 
164 //HTTP authentication supported?
165 #if (HTTP_CLIENT_BASIC_AUTH_SUPPORT == ENABLED)
166  #define HTTP_CLIENT_AUTH_SUPPORT ENABLED
167 #elif (HTTP_CLIENT_DIGEST_AUTH_SUPPORT == ENABLED)
168  #define HTTP_CLIENT_AUTH_SUPPORT ENABLED
169 #else
170  #define HTTP_CLIENT_AUTH_SUPPORT DISABLED
171 #endif
172 
173 //Application specific context
174 #ifndef HTTP_CLIENT_PRIVATE_CONTEXT
175  #define HTTP_CLIENT_PRIVATE_CONTEXT
176 #endif
177 
178 //TLS supported?
179 #if (HTTP_CLIENT_TLS_SUPPORT == ENABLED)
180  #include "core/crypto.h"
181  #include "tls.h"
182 #endif
183 
184 //Basic authentication supported?
185 #if (HTTP_CLIENT_BASIC_AUTH_SUPPORT == ENABLED)
186  #include "core/crypto.h"
187  #include "encoding/base64.h"
188 #endif
189 
190 //Digest access authentication supported?
191 #if (HTTP_CLIENT_DIGEST_AUTH_SUPPORT == ENABLED)
192  #include "core/crypto.h"
193  #include "hash/hash_algorithms.h"
194 #endif
195 
196 //Forward declaration of HttpClientContext structure
197 struct _HttpClientContext;
198 #define HttpClientContext struct _HttpClientContext
199 
200 //C++ guard
201 #ifdef __cplusplus
202 extern "C" {
203 #endif
204 
205 
206 /**
207  * @brief HTTP client states
208  */
209 
210 typedef enum
211 {
217 
218 
219 //TLS supported?
220 #if (HTTP_CLIENT_TLS_SUPPORT == ENABLED)
221 
222 /**
223  * @brief TLS initialization callback function
224  **/
225 
228 
229 #endif
230 
231 
232 /**
233  * @brief Random data generation callback function
234  **/
235 
236 typedef error_t (*HttpClientRandCallback)(uint8_t *data, size_t length);
237 
238 
239 /**
240  * @brief HTTP authentication parameters
241  **/
242 
243 typedef struct
244 {
245  HttpAuthMode mode; ///<HTTP authentication mode
246  char_t username[HTTP_CLIENT_MAX_USERNAME_LEN + 1]; ///<User name
247  char_t password[HTTP_CLIENT_MAX_PASSWORD_LEN + 1]; ///<Password
248  char_t realm[HTTP_CLIENT_MAX_REALM_LEN + 1]; ///<Realm
249 #if (HTTP_CLIENT_DIGEST_AUTH_SUPPORT == ENABLED)
250  HttpAuthQop qop; ///<Quality of protection
251  const HashAlgo *algorithm; ///<Digest algorithm
252  uint32_t nc; ///<Nonce count
253  char_t nonce[HTTP_CLIENT_MAX_NONCE_LEN + 1]; ///<Nonce value
254  char_t cnonce[HTTP_CLIENT_CNONCE_SIZE * 2 + 1]; ///<Cnonce value
255  char_t opaque[HTTP_CLIENT_MAX_OPAQUE_LEN + 1]; ///<Opaque parameter
256  bool_t stale; ///<Stale flag
257 #endif
259 
260 
261 /**
262  * @brief HTTP client context
263  **/
264 
266 {
267  HttpClientState state; ///<HTTP client state
268  HttpVersion version; ///<HTTP protocol version
269  NetInterface *interface; ///<Underlying network interface
270  systime_t timeout; ///<Timeout value
271  systime_t timestamp; ///<Timestamp to manage timeout
272  Socket *socket; ///<Underlying socket
273 #if (HTTP_CLIENT_TLS_SUPPORT == ENABLED)
274  TlsContext *tlsContext; ///<TLS context
275  TlsSessionState tlsSession; ///<TLS session state
276  HttpClientTlsInitCallback tlsInitCallback; ///<TLS initialization callback function
277 #endif
278  IpAddr serverIpAddr; ///<IP address of the HTTP server
279  uint16_t serverPort; ///<TCP port number
280 #if (HTTP_CLIENT_AUTH_SUPPORT == ENABLED)
281  HttpClientAuthParams authParams; ///<HTTP authentication parameters
282 #endif
283 #if (HTTP_CLIENT_DIGEST_AUTH_SUPPORT == ENABLED)
284  HttpClientRandCallback randCallback; ///<Random data generation callback function
285 #endif
286  HttpRequestState requestState; ///<HTTP request state
287  char_t method[HTTP_CLIENT_MAX_METHOD_LEN + 1]; ///<HTTP request method
288  bool_t keepAlive; ///<HTTP persistent connection
289  bool_t chunkedEncoding; ///<Chunked transfer encoding
290  char_t buffer[HTTP_CLIENT_BUFFER_SIZE + 1]; ///<Memory buffer for input/output operations
291  size_t bufferLen; ///<Length of the buffer, in bytes
292  size_t bufferPos; ///<Current position in the buffer
293  size_t bodyLen; ///<Length of the body, in bytes
294  size_t bodyPos; ///<Current position in the body
295  uint_t statusCode; ///<HTTP status code
296  HTTP_CLIENT_PRIVATE_CONTEXT ///<Application specific context
297 };
298 
299 
300 //HTTP client related functions
302 
303 #if (HTTP_CLIENT_TLS_SUPPORT == ENABLED)
304 
306  HttpClientTlsInitCallback callback);
307 
308 #endif
309 
311  HttpClientRandCallback callback);
312 
315 
317  const char_t *username, const char_t *password);
318 
320  NetInterface *interface);
321 
323  const IpAddr *serverIpAddr, uint16_t serverPort);
324 
326 error_t httpClientSetMethod(HttpClientContext *context, const char_t *method);
327 error_t httpClientSetUri(HttpClientContext *context, const char_t *uri);
328 
329 error_t httpClientSetHost(HttpClientContext *context, const char_t *host,
330  uint16_t port);
331 
333  const char_t *queryString);
334 
336  const char_t *name, const char_t *value);
337 
339  const char_t *name, const char_t *value);
340 
342  const char_t *name, const char_t *format, ...);
343 
346 
347 error_t httpClientWriteBody(HttpClientContext *context, const void *data,
348  size_t length, size_t *written, uint_t flags);
349 
351 
354 
356  const char_t *name);
357 
359  const char_t **name, const char_t **value);
360 
362  size_t size, size_t *received, uint_t flags);
363 
366 
369 
370 void httpClientDeinit(HttpClientContext *context);
371 
372 //C++ guard
373 #ifdef __cplusplus
374 }
375 #endif
376 
377 #endif
error_t httpClientGetNextHeaderField(HttpClientContext *context, const char_t **name, const char_t **value)
Iterate through the HTTP response header.
Definition: http_client.c:1598
#define HTTP_CLIENT_MAX_PASSWORD_LEN
Definition: http_client.h:131
HttpClientState
HTTP client states.
Definition: http_client.h:211
NetInterface * interface
Underlying network interface.
Definition: http_client.h:269
int bool_t
Definition: compiler_port.h:53
error_t httpClientCloseBody(HttpClientContext *context)
Close HTTP request or response body.
Definition: http_client.c:2012
IP network address.
Definition: ip.h:90
error_t httpClientSetAuthInfo(HttpClientContext *context, const char_t *username, const char_t *password)
Set authentication information.
Definition: http_client.c:209
Socket * socket
Underlying socket.
Definition: http_client.h:272
HttpVersion
HTTP version numbers.
Definition: http_common.h:60
error_t httpClientWriteBody(HttpClientContext *context, const void *data, size_t length, size_t *written, uint_t flags)
Write HTTP request body.
Definition: http_client.c:1137
HttpClientRandCallback randCallback
Random data generation callback function.
Definition: http_client.h:284
error_t(* HttpClientTlsInitCallback)(HttpClientContext *context, TlsContext *tlsContext)
TLS initialization callback function.
Definition: http_client.h:226
error_t httpClientWriteHeader(HttpClientContext *context)
Write HTTP request header.
Definition: http_client.c:1014
HttpClientState state
HTTP client state.
Definition: http_client.h:267
uint8_t data[]
Definition: ethernet.h:222
error_t httpClientSetHost(HttpClientContext *context, const char_t *host, uint16_t port)
Set the hostname and port number of the resource being requested.
Definition: http_client.c:533
error_t httpClientSetVersion(HttpClientContext *context, HttpVersion version)
Set the HTTP protocol version to be used.
Definition: http_client.c:162
uint_t httpClientGetStatus(HttpClientContext *context)
Retrieve the HTTP status code of the response.
Definition: http_client.c:1512
HttpClientTlsInitCallback tlsInitCallback
TLS initialization callback function.
Definition: http_client.h:276
size_t bufferLen
Length of the buffer, in bytes.
Definition: http_client.h:291
bool_t keepAlive
HTTP persistent connection.
Definition: http_client.h:288
void httpClientDeinit(HttpClientContext *context)
Release HTTP client context.
Definition: http_client.c:2245
#define HTTP_CLIENT_MAX_METHOD_LEN
Definition: http_client.h:117
error_t httpClientSetContentLength(HttpClientContext *context, size_t length)
Set the length of the HTTP request body.
Definition: http_client.c:987
char_t name[]
error_t httpClientAddQueryParam(HttpClientContext *context, const char_t *name, const char_t *value)
Add a key/value pair to the query string.
Definition: http_client.c:691
uint8_t version
Definition: coap_common.h:177
error_t httpClientClose(HttpClientContext *context)
Close the connection with the HTTP server.
Definition: http_client.c:2224
HttpClientAuthParams authParams
HTTP authentication parameters.
Definition: http_client.h:281
error_t httpClientReadTrailer(HttpClientContext *context)
Read HTTP trailer.
Definition: http_client.c:1884
TlsContext * tlsContext
TLS context.
Definition: http_client.h:274
uint16_t serverPort
TCP port number.
Definition: http_client.h:279
error_t httpClientWriteTrailer(HttpClientContext *context)
Write HTTP trailer.
Definition: http_client.c:1293
IpAddr serverIpAddr
IP address of the HTTP server.
Definition: http_client.h:278
error_t httpClientSetQueryString(HttpClientContext *context, const char_t *queryString)
Set query string.
Definition: http_client.c:594
#define HttpClientContext
Definition: http_client.h:198
#define HTTP_CLIENT_MAX_OPAQUE_LEN
Definition: http_client.h:159
TlsSessionState tlsSession
TLS session state.
Definition: http_client.h:275
#define TlsContext
Definition: tls.h:36
error_t
Error codes.
Definition: error.h:43
error_t httpClientConnect(HttpClientContext *context, const IpAddr *serverIpAddr, uint16_t serverPort)
Establish a connection with the specified HTTP server.
Definition: http_client.c:269
#define NetInterface
Definition: net.h:36
General definitions for cryptographic algorithms.
#define HTTP_CLIENT_MAX_NONCE_LEN
Definition: http_client.h:145
const char_t * httpClientGetHeaderField(HttpClientContext *context, const char_t *name)
Retrieve the value of the specified header field name.
Definition: http_client.c:1539
error_t httpClientInit(HttpClientContext *context)
Initialize HTTP client context.
Definition: http_client.c:66
Base64 encoding scheme.
#define HTTP_CLIENT_MAX_REALM_LEN
Definition: http_client.h:138
@ HTTP_CLIENT_STATE_DISCONNECTING
Definition: http_client.h:215
uint8_t length
Definition: tcp.h:368
error_t httpClientRegisterRandCallback(HttpClientContext *context, HttpClientRandCallback callback)
Register random data generation callback function.
Definition: http_client.c:135
char_t buffer[HTTP_CLIENT_BUFFER_SIZE+1]
Memory buffer for input/output operations.
Definition: http_client.h:290
HttpAuthQop
Quality of protection (digest authentication)
Definition: http_common.h:84
uint_t statusCode
HTTP status code.
Definition: http_client.h:295
error_t httpClientAddHeaderField(HttpClientContext *context, const char_t *name, const char_t *value)
Add a header field to the HTTP request.
Definition: http_client.c:808
error_t httpClientSetTimeout(HttpClientContext *context, systime_t timeout)
Set communication timeout.
Definition: http_client.c:187
Collection of hash algorithms.
error_t(* HttpClientRandCallback)(uint8_t *data, size_t length)
Random data generation callback function.
Definition: http_client.h:236
error_t httpClientDisconnect(HttpClientContext *context)
Gracefully disconnect from the HTTP server.
Definition: http_client.c:2149
uint32_t systime_t
System time.
uint16_t port
Definition: dns_common.h:267
bool_t chunkedEncoding
Chunked transfer encoding.
Definition: http_client.h:289
Definitions common to HTTP client and server.
uint8_t flags
Definition: tcp.h:351
char_t method[HTTP_CLIENT_MAX_METHOD_LEN+1]
HTTP request method.
Definition: http_client.h:287
char char_t
Definition: compiler_port.h:48
error_t httpClientBindToInterface(HttpClientContext *context, NetInterface *interface)
Bind the HTTP client to a particular network interface.
Definition: http_client.c:246
size_t bodyPos
Current position in the body.
Definition: http_client.h:294
error_t httpClientCreateRequest(HttpClientContext *context)
Create a new HTTP request.
Definition: http_client.c:365
TLS session state.
Definition: tls.h:2038
HttpAuthQop qop
Quality of protection.
Definition: http_client.h:250
#define HTTP_CLIENT_MAX_USERNAME_LEN
Definition: http_client.h:124
systime_t timeout
Timeout value.
Definition: http_client.h:270
const HashAlgo * algorithm
Digest algorithm.
Definition: http_client.h:251
error_t httpClientReadHeader(HttpClientContext *context)
Read HTTP response header.
Definition: http_client.c:1372
HTTP authentication parameters.
Definition: http_client.h:244
HTTP client context.
Definition: http_client.h:266
#define HTTP_CLIENT_CNONCE_SIZE
Definition: http_client.h:152
#define Socket
Definition: socket.h:36
@ HTTP_CLIENT_STATE_DISCONNECTED
Definition: http_client.h:212
uint8_t value[]
Definition: tcp.h:369
@ HTTP_CLIENT_STATE_CONNECTING
Definition: http_client.h:213
size_t bufferPos
Current position in the buffer.
Definition: http_client.h:292
TLS (Transport Layer Security)
systime_t timestamp
Timestamp to manage timeout.
Definition: http_client.h:271
#define HTTP_CLIENT_PRIVATE_CONTEXT
Definition: http_client.h:175
#define HTTP_CLIENT_BUFFER_SIZE
Definition: http_client.h:96
Common interface for hash algorithms.
Definition: crypto.h:1046
size_t bodyLen
Length of the body, in bytes.
Definition: http_client.h:293
error_t httpClientRegisterTlsInitCallback(HttpClientContext *context, HttpClientTlsInitCallback callback)
Register TLS initialization callback function.
Definition: http_client.c:111
HttpVersion version
HTTP protocol version.
Definition: http_client.h:268
error_t httpClientReadBody(HttpClientContext *context, void *data, size_t size, size_t *received, uint_t flags)
Read HTTP response body.
Definition: http_client.c:1646
unsigned int uint_t
Definition: compiler_port.h:50
HttpRequestState
HTTP request states.
Definition: http_common.h:110
TCP/IP stack core.
uint32_t nc
Nonce count.
Definition: http_client.h:252
bool_t stale
Stale flag.
Definition: http_client.h:256
@ HTTP_CLIENT_STATE_CONNECTED
Definition: http_client.h:214
HttpAuthMode
HTTP authentication schemes.
Definition: http_common.h:72
error_t httpClientSetMethod(HttpClientContext *context, const char_t *method)
Set HTTP request method.
Definition: http_client.c:402
error_t httpClientSetUri(HttpClientContext *context, const char_t *uri)
Set request URI.
Definition: http_client.c:462
HttpAuthMode mode
HTTP authentication mode.
Definition: http_client.h:245
uint8_t nonce[]
Definition: ntp_common.h:233
HttpRequestState requestState
HTTP request state.
Definition: http_client.h:286
error_t httpClientFormatHeaderField(HttpClientContext *context, const char_t *name, const char_t *format,...)
Format an HTTP header field.
Definition: http_client.c:890