A HTTP/HTTPS Client for the mbed networking/CyaSSL ssl library
Dependents: Anpi dropbox_access php_access_auth TwitterReader ... more
Fork of HTTPClient by
HTTP and HTTPS Client Class with wolfSSL, embedded SSL library.
The class was forked from http://mbed.org/users/donatien/code/HTTPClient/
It, now, accepts url both with "http://" and "https://".
Allocate caller thread with 16kbytes or larger stack for "https" requests.
Rest of the API stays compatible with HTTPClient.
For more about the library, see http://www.wolfssl.com. http://wolfssl.com/yaSSL/Docs.html.
Extended methods:
- HTTPResult basicAuth(const char* user, const char* password); /* set id/passwd for basic Authentication */
- void setHeader(char *header) ; /* set http headers */
- HTTPResult setSSLversion(int minorV) ; /* set SSL/TLS version. 0: SSL3, 1: TLS1.0, 2: TLS1.1, 3: TLS1.2 */
Diff: HTTPClient.h
- Revision:
- 33:77082c88748a
- Parent:
- 31:7fd621b83b60
--- a/HTTPClient.h Mon Jul 20 09:21:07 2015 +0000 +++ b/HTTPClient.h Tue Jul 21 01:07:25 2015 +0000 @@ -121,8 +121,10 @@ @return The HTTP response code of the last request */ int getHTTPResponseCode(); - + void setHeader(const char *header) ; /* set http headers */ + void dumpReqHeader(bool sw) ; /* switch on dumpling request headers */ + void dumpResHeader(bool sw) ; /* switch on dumpling response headers */ HTTPResult setSSLversion(int minorV) ; /* set SSL/TLS version. 0: SSL3, 1: TLS1.0, 2: TLS1.1, 3: TLS1.2 */ void setLocationBuf(char *url, int size) ; /* set URL buffer for redirection */ @@ -142,7 +144,6 @@ HTTPResult parseURL(const char* url, char* scheme, size_t maxSchemeLen, char* host, size_t maxHostLen, uint16_t* port, char* path, size_t maxPathLen); //Parse URL void wolfssl_free(void) ; HTTPResult bAuth(void) ; - HTTPResult readHeader(void) ; //Parameters @@ -156,8 +157,10 @@ char * redirect_url ; int redirect_url_size ; int redirect ; + bool dumpReqH ; + bool dumpResH ; - /* for CyaSSL */ + /* for wolfSSL */ int SSLver ; uint16_t port; struct WOLFSSL_CTX* ctx ;