#ifndef HTTP_CLIENT_H
#define HTTP_CLIENT_H

#define HTTP_PRINTF printf 

#include "stdint.h"


int http_clientConnectToServer(char *host, int port, int hostIsIp);
void http_clientClose(int sock);

int http_clientPacketRequest_GET(int sock, char *host, char *url);
int http_clientReadResponse_GET(int sock, uint8_t *pbuf, int *datlen);
int http_clientGet(char *host, char *url, uint16_t port, uint8_t hostIsIp,uint8_t *pbuf, int *datalen);

int http_clientPacketRequest_POST(int sock, char *host, char *url, int datalen);
int http_clientPacketBody_POST(int sock, uint8_t *pbuf, int datalen);
int http_clientReadResponse_POST(int sock, uint8_t *pbuf, int *datlen);
int http_clientPost(char *host, char *url, uint16_t port, uint8_t hostIsIp, uint8_t *postbuf, int postlen, uint8_t *rtnbuf, int *rtnlen);

#endif 


