1 // ============================================================================
2 // Artsoft Retro-Game Library
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2021 by Artsoft Entertainment
7 // https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
17 #define MAX_HTTP_HEAD_SIZE 4096
18 #define MAX_HTTP_BODY_SIZE 1048576
19 #define MAX_HTTP_ERROR_SIZE 1024
21 #define HTTP_SUCCESS(c) ((c) >= 200 && (c) < 300)
26 char head[MAX_HTTP_HEAD_SIZE + 1];
27 char body[MAX_HTTP_BODY_SIZE + 1];
37 char head[MAX_HTTP_HEAD_SIZE + 1];
38 char body[MAX_HTTP_BODY_SIZE + 1];
42 char status_text[MAX_HTTP_ERROR_SIZE + 1];
46 char *GetHttpError(void);
47 void ConvertHttpRequestBodyToServerEncoding(struct HttpRequest *);
48 void ConvertHttpResponseBodyToClientEncoding(struct HttpResponse *);
49 struct HttpResponse *GetHttpResponseFromBuffer(void *, int);
50 boolean DoHttpRequest(struct HttpRequest *, struct HttpResponse *);