http.h

simple http library for c99
git clone git://git.kocotian.pl/http.h.git
Log | Files | Refs | README | LICENSE

commit e5dd5bbb66d50d529f44a3799fc875d64293fc23
parent a63ce70422ea2e129942cea123d8a7e6d127acec
Author: kocotian <54662947+kocotian@users.noreply.github.com>
Date:   Sun, 11 Oct 2020 17:07:58 +0200

version 0.1.1

added truncateHeader(data) function that returns pointer to response (from data)
Diffstat:
Mhttp.h | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/http.h b/http.h @@ -3,6 +3,13 @@ #define _XOPEN_SOURCE 700 +/* + * http.h + * simple and small http library for C99 + * version 0.1.1 + * creator: kocotian + */ + #include <arpa/inet.h> #include <netdb.h> #include <netinet/in.h> @@ -19,6 +26,7 @@ long long int httpGET(char *hostname, unsigned short port, char *path, char **buffer); int getResponseStatus(char *response); int parseResponseLine(char *response, char *value, char **buffer); +char *truncateHeader(char *response); long long int httpGET(char *hostname, unsigned short port, char *path, char **buffer) @@ -122,4 +130,9 @@ parseResponseLine(char *response, char *value, char **buffer) return -1; } +char *truncateHeader(char *response) +{ + return strstr(response, "\r\n\r\n") + 4; +} + #endif