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.
Diff: HTTPClient.h
- Revision:
- 36:debaeb6006a7
- Parent:
- 29:2d96cc752d19
- Child:
- 50:a18a06b000f3
--- a/HTTPClient.h Fri Sep 12 20:36:21 2014 +0000 +++ b/HTTPClient.h Wed Sep 17 21:36:14 2014 +0000 @@ -60,6 +60,13 @@ ~HTTPClient(); /** + Provides a OAUTH2 authentification feature + Pass NULL pointer to switch back to no authentication + @param token OAUTH2 token + */ + HTTPResult oauthToken(const char* token); // OAUTH2 Token Authentification + + /** Provides a basic authentification feature (Base64 encoded username and password) Pass two NULL pointers to switch back to no authentication @param user username to use for authentication, must remain valid durlng the whole HTTP session @@ -142,6 +149,7 @@ 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 cyassl_free(void) ; HTTPResult bAuth(void) ; + HTTPResult tokenAuth(void) ; HTTPResult readHeader(void) ; //Parameters @@ -150,6 +158,7 @@ const char* m_basicAuthUser; const char* m_basicAuthPassword; + const char* m_oauthToken; int m_httpResponseCode; const char * header ;