diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2022-09-15 19:35:27 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2022-09-15 19:39:50 +0300 |
| commit | ff34cebaa50ebac63643a5e58989e416e09de4b9 (patch) | |
| tree | 5118bf17a9ca08cad49388b8847c2c0e0f3d035e /src/http.h | |
| download | sqlite-http-c-ff34cebaa50ebac63643a5e58989e416e09de4b9.tar.gz sqlite-http-c-ff34cebaa50ebac63643a5e58989e416e09de4b9.zip | |
Initial commit
Diffstat (limited to 'src/http.h')
| -rw-r--r-- | src/http.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/http.h b/src/http.h new file mode 100644 index 0000000..f215cf6 --- /dev/null +++ b/src/http.h @@ -0,0 +1,38 @@ +#ifndef HTTP_H +#define HTTP_H + +#include "sqlite3ext.h" + +typedef struct http_request http_request; +struct http_request { + char* zMethod; + char* zUrl; + const void* pBody; + sqlite3_int64 szBody; + const char* zHeaders; +}; + +typedef struct http_response http_response; +struct http_response { + void* pBody; + sqlite3_int64 szBody; + char* zHeaders; + int szHeaders; + int iStatusCode; + char* zStatus; +}; + +int http_do_request(http_request* req, http_response* resp, char** ppErrMsg); + +int http_next_header(const char* headers, + int size, + int* pParsed, + const char** ppName, + int* pNameSize, + const char** ppValue, + int* pValueSize); + +void remove_all_but_last_headers(char* zHeaders); +void separate_status_and_headers(char** ppStatus, char* zHeaders); + +#endif |
