mbed.org implementation of the abstract SmartREST library for the Cumulocity Platform SmartREST protocol.

Dependents:   MbedSmartRestMain MbedSmartRestMain

Revision:
2:45a6e44a4fb4
Parent:
1:9a11a331e340
Child:
5:2b74510900da
--- a/AbstractClient.h	Mon Jul 07 16:14:51 2014 +0200
+++ b/AbstractClient.h	Mon Jul 07 17:08:02 2014 +0200
@@ -48,11 +48,9 @@
 
 /*
  * An abstraction layer for the SmartREST http client.
- * Constructor arguments such as username and password strings must
- * not be cpoied but instead stored as pointer as they are subject to
- * change.
  * 
  * All methods have to be called in the following order:
+ * - setAuthorization()
  * - beginRequest()
  * - sendIdentifier() (optional)
  * - sendData() (optional)
@@ -70,6 +68,16 @@
     virtual ~AbstractClient() { };
 
     /**
+     * Sets authorization username and password. This method can only be
+     * called when no request is processing. Values set using this method
+     * must be kept in memory until either new values are set or the object
+     * is being destroyed.
+     * @param username the username used for further request authorization
+     * @param password the password used for further request authorization
+     */
+    virtual uint8_t setAuthorization(const char*, const char*) = 0;
+
+    /**
      * Begins a new request. This method has to be the first call for
      * any request. A connection to the server will be established
      * and the start of a HTTP post request will be sent over the