-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresponse.h
More file actions
29 lines (22 loc) · 739 Bytes
/
Copy pathresponse.h
File metadata and controls
29 lines (22 loc) · 739 Bytes
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
#ifndef HEADER__RESPONSE
#define HEADER__RESPONSE
#include "request.h"
#include "header.h"
#include "utils.h"
struct http_response_t
{
int protocol;
int status_code;
int timestamp;
// Headers
struct http_header_t headers[MAX_HTTP_HEADER_COUNT];
int header_count;
// Body
char *body;
long body_length;
} http_response_t;
int init_http_response(struct http_response_t *response, struct http_request_t *request);
int render_http_response(struct http_response_t *response, char **rendered, int *rendered_length);
int add_http_response_header(struct http_response_t *response, char *key, char *value);
int set_http_response_body(struct http_response_t *response, char *body, long body_length);
#endif