http.h

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

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

Update README.md
Diffstat:
MREADME.md | 18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md @@ -9,24 +9,24 @@ for example, GET / from suckless.org on port 80: int main() { - char *response; long long int size; - if(!(size = httpGET("suckless.org", 80, "/", &response))) return -1; - printf("%s", response); - free(response); - return 0; + char *response; long long int size; + if(!(size = httpGET("suckless.org", 80, "/", &response))) return -1; + printf("%s", response); + free(response); + return 0; } ``` same as higher, but without HTTP header: ```c -#include "../http.h" +#include "http.h" int main() { - char *response, *data; long long int size; - if(!(size = httpGET("suckless.org", 80, "/", &response))) return -1; + char *response, *data; long long int size; + if(!(size = httpGET("suckless.org", 80, "/", &response))) return -1; data = strstr(response, "\r\n\r\n") + 4; - printf("%s", data); + printf("%s", data); free(response); return 0; }