Free (GPLv2) TCP/IP stack developed by TASS Belgium
Fork of PicoTCP by
Diff: modules/pico_http_client.h
- Revision:
- 3:b4047e8a0123
diff -r d12a891f2eca -r b4047e8a0123 modules/pico_http_client.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/pico_http_client.h Fri May 24 15:25:25 2013 +0000 @@ -0,0 +1,49 @@ +/********************************************************************* +PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved. +See LICENSE and COPYING for usage. + +Author: Andrei Carp <andrei.carp@tass.be> +*********************************************************************/ + + +#ifndef PICO_HTTP_CLIENT_H_ +#define PICO_HTTP_CLIENT_H_ + +#include "pico_http_util.h" + +/* + * Transfer encodings + */ +#define HTTP_TRANSFER_CHUNKED 1u +#define HTTP_TRANSFER_FULL 0u + +/* + * Parameters for the send header function + */ +#define HTTP_HEADER_RAW 0u +#define HTTP_HEADER_DEFAULT 1u + +/* + * Data types + */ + +struct pico_http_header +{ + uint16_t responseCode; // http response + char * location; // if redirect is reported + uint32_t contentLengthOrChunk; // size of the message + uint8_t transferCoding; // chunked or full + +}; + +int pico_http_client_open(char * uri, void (*wakeup)(uint16_t ev, uint16_t conn)); +int pico_http_client_sendHeader(uint16_t conn, char * header, int hdr); + +struct pico_http_header * pico_http_client_readHeader(uint16_t conn); +struct pico_http_uri * pico_http_client_readUriData(uint16_t conn); +char * pico_http_client_buildHeader(const struct pico_http_uri * uriData); + +int pico_http_client_readData(uint16_t conn, char * data, uint16_t size); +int pico_http_client_close(uint16_t conn); + +#endif /* PICO_HTTP_CLIENT_H_ */