Files
cweb/http/http_response.h
2024-11-07 12:02:29 +01:00

24 lines
515 B
C

#ifndef HTTP_RESPONSE_H
#define HTTP_RESPONSE_H
#include "http_content_type.h"
#include "http_status.h"
#include <stdbool.h>
#include <stddef.h>
typedef struct {
HttpStatus status_code;
HttpContentType content_type;
size_t content_length;
char *body;
} HttpResponse;
bool construct_response(HttpResponse __res, char *out);
void http_respond(HttpResponse __res, int clientfd);
char *read_file(const char *__path);
HttpResponse *from_file(const char *__path);
void free_response(HttpResponse *__res);
#endif