http_client.h 813 B

1234567891011121314151617181920212223
  1. #ifndef HTTP_CLIENT_H
  2. #define HTTP_CLIENT_H
  3. #define HTTP_PRINTF printf
  4. #include "stdint.h"
  5. int http_clientConnectToServer(char *host, int port, int hostIsIp);
  6. void http_clientClose(int sock);
  7. int http_clientPacketRequest_GET(int sock, char *host, char *url);
  8. int http_clientReadResponse_GET(int sock, uint8_t *pbuf, int *datlen);
  9. int http_clientGet(char *host, char *url, uint16_t port, uint8_t hostIsIp,uint8_t *pbuf, int *datalen);
  10. int http_clientPacketRequest_POST(int sock, char *host, char *url, int datalen);
  11. int http_clientPacketBody_POST(int sock, uint8_t *pbuf, int datalen);
  12. int http_clientReadResponse_POST(int sock, uint8_t *pbuf, int *datlen);
  13. int http_clientPost(char *host, char *url, uint16_t port, uint8_t hostIsIp, uint8_t *postbuf, int postlen, uint8_t *rtnbuf, int *rtnlen);
  14. #endif