This commit is contained in:
cdricms
2024-10-28 12:06:06 +01:00
commit 658fe48bb8
9 changed files with 569 additions and 0 deletions

19
main.c Normal file
View File

@@ -0,0 +1,19 @@
#include "http/http_response.h"
#include "http/http_status.h"
#include <stdio.h>
#include <string.h>
int main() {
char body[BUFSIZ] = "<html><h1>Bonsoir</h1></html>";
HttpResponse response = {.status_code = HTTP_OK,
.content_type = HTTP_CT_HTML,
.content_length = strlen(body),
.body = body};
char out[BUFSIZ];
construct_response(response, out);
printf("%s", out);
return 0;
}