Fork of the working HTTPClient adaptation using CyaSSL. This version adds a derivation of HTTPText called HTTPJson to emit JSON text properly. Additionally, the URL parser has defines that permit longer URLs to be utilized.
Dependents: SalesforceInterface df-2014-heroku-thermostat-k64f SalesforceInterface
Fork of HTTPClient by
This is a fork of the working HTTPS/SSL library that contains two extensions:
- HTTPJson - a derivation of HTTPText for emitting JSON strings specifically. No JSON parsing/checking is accomplished - HTTPJson simply sets the right Content-Type for HTTP(S).
- Expanded internal buffers for longer URLs. This is set in HTTPClient.cpp and is tunable.
Revision 35:16f0a44cc53e, committed 2014-09-12
- Comitter:
- ansond
- Date:
- Fri Sep 12 20:36:21 2014 +0000
- Parent:
- 34:7a7e395f8df3
- Child:
- 36:debaeb6006a7
- Commit message:
- updated with thread-safe wait()
Changed in this revision
HTTPClient.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/HTTPClient.cpp Fri Aug 29 04:47:47 2014 +0000 +++ b/HTTPClient.cpp Fri Sep 12 20:36:21 2014 +0000 @@ -21,6 +21,10 @@ #define MAX_URL_HOSTNAME_LENGTH 128 #define MAX_URL_PATH_LENGTH 128 +// DMA: mbed +#include "mbed.h" +#include "rtos.h" + //Debug is disabled by default #if 0 //Enable debug @@ -70,7 +74,7 @@ for(i=0; i<RECV_RETRY; i++) { n = m_sock.receive(buf, sz) ; if(n >= 0)return n ; - wait(0.2) ; + Thread::wait(200) ; } ERR("SocketReceive:%d/%d\n", n, sz) ; return n ; @@ -80,10 +84,10 @@ { int n ; - wait(0.1) ; + Thread::wait(100) ; n = m_sock.send(buf, sz); if(n > 0) { - wait(0.3) ; + Thread::wait(300) ; return n ; } else ERR("SocketSend:%d/%d\n", n, sz); return n ;