A HTTP Client for the mbed networking libraries with HTTPFile for use with latest networking stack
Fork of HTTPClient by
An extension of the HTTPClient that adds HTTPFile. Currently on get is support and only works when getting binary files.
HTTPFile data("/local/firm.bin"); HTTPResult r = client.get("https://217.140.101.20/media/uploads/ollie8/firm.bin", &data); if (r == HTTP_OK) { }
Diff: HTTPClient.cpp
- Revision:
- 1:b70c37cf73ca
- Parent:
- 0:2ccb9960a044
- Child:
- 2:75f5b83238af
--- a/HTTPClient.cpp Thu Apr 26 13:04:56 2012 +0000 +++ b/HTTPClient.cpp Thu Apr 26 14:17:23 2012 +0000 @@ -154,6 +154,9 @@ return NET_CONN; } + size_t recvContentLength = 0; + bool recvChunked = false; + //Send all headers //Send default headers @@ -271,8 +274,6 @@ memmove(buf, &buf[crlfPos+2], trfLen - (crlfPos + 2)); trfLen -= (crlfPos + 2); - size_t recvContentLength = 0; - bool recvChunked = false; //Now get headers while( true ) { @@ -625,4 +626,3 @@ return OK; } -