Files
vpp/src/plugins/http/http_status_codes.h
Matus Fabian ba9ea13e26 http: client code improvement
Client app can sends request target, custom header and body to
HTTP layer. In response it receives all bytes as received from
transport, aditionally we provide offset and length of headers
and body.
In addtion client app is now able to receive response with all
status codes and Host header field is set in request at protocol
layer.

Type: improvement

Change-Id: I8c8e2c8f99cdf500126b7c2c722aebc254aa0d9f
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2024-07-29 14:21:12 +02:00

28 lines
670 B
C

/* SPDX-License-Identifier: Apache-2.0
* Copyright(c) 2024 Cisco Systems, Inc.
*/
#ifndef SRC_PLUGINS_HTTP_HTTP_STATUS_CODES_H_
#define SRC_PLUGINS_HTTP_HTTP_STATUS_CODES_H_
#include <http/http.h>
const char *http_status_code_str[] = {
#define _(c, s, str) str,
foreach_http_status_code
#undef _
};
static inline u8 *
format_http_status_code (u8 *s, va_list *va)
{
http_status_code_t status_code = va_arg (*va, http_status_code_t);
if (status_code < HTTP_N_STATUS)
s = format (s, "%s", http_status_code_str[status_code]);
else
s = format (s, "invalid status code %d", status_code);
return s;
}
#endif /* SRC_PLUGINS_HTTP_HTTP_STATUS_CODES_H_ */