mirror of
https://github.com/opus-tango/http-server-in-c.git
synced 2026-03-20 03:55:25 +00:00
start working on proper HTTP parser
This commit is contained in:
@@ -1,10 +1,30 @@
|
||||
#ifndef HTTP_RESPONSE_BUILDER_H
|
||||
#define HTTP_RESPONSE_BUILDER_H
|
||||
#ifndef REQUEST_HANDLER_H
|
||||
#define REQUEST_HANDLER_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
struct http_request {
|
||||
char* method;
|
||||
char* url;
|
||||
char** headers;
|
||||
int num_headers;
|
||||
char* body;
|
||||
size_t body_length;
|
||||
};
|
||||
|
||||
struct http_response {
|
||||
char* status_line;
|
||||
char** headers;
|
||||
int num_headers;
|
||||
char* body;
|
||||
size_t body_length;
|
||||
};
|
||||
|
||||
typedef struct http_request http_request;
|
||||
typedef struct http_response http_response;
|
||||
|
||||
void handle_request(char* request, int length, char* response,
|
||||
size_t* response_length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user