Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of PicoTCP by
Diff: modules/pico_http_client.h
- Revision:
- 29:1a47b7151851
- Parent:
- 3:b4047e8a0123
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/pico_http_client.h Sun Jun 16 20:19:44 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_ */