Core Base Classes for the Light Endpoints

Dependencies:   BufferedSerial

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more

Committer:
ansond
Date:
Sat Mar 01 05:57:50 2014 +0000
Revision:
37:1588ba3af6d1
Parent:
30:bf56ef794ba6
Child:
96:686ec39400dc
updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 30:bf56ef794ba6 1 /* Copyright C2013 Doug Anson, MIT License
ansond 30:bf56ef794ba6 2 *
ansond 30:bf56ef794ba6 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
ansond 30:bf56ef794ba6 4 * and associated documentation files the "Software", to deal in the Software without restriction,
ansond 30:bf56ef794ba6 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
ansond 30:bf56ef794ba6 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
ansond 30:bf56ef794ba6 7 * furnished to do so, subject to the following conditions:
ansond 30:bf56ef794ba6 8 *
ansond 30:bf56ef794ba6 9 * The above copyright notice and this permission notice shall be included in all copies or
ansond 30:bf56ef794ba6 10 * substantial portions of the Software.
ansond 30:bf56ef794ba6 11 *
ansond 30:bf56ef794ba6 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ansond 30:bf56ef794ba6 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
ansond 30:bf56ef794ba6 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
ansond 30:bf56ef794ba6 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
ansond 30:bf56ef794ba6 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ansond 30:bf56ef794ba6 17 */
ansond 30:bf56ef794ba6 18
ansond 37:1588ba3af6d1 19 #ifndef _HTTP_TRANSPORT_H_
ansond 37:1588ba3af6d1 20 #define _HTTP_TRANSPORT_H_
ansond 30:bf56ef794ba6 21
ansond 30:bf56ef794ba6 22 // Base Class
ansond 30:bf56ef794ba6 23 #include "Transport.h"
ansond 30:bf56ef794ba6 24
ansond 30:bf56ef794ba6 25 // HTTP Client Library Support
ansond 30:bf56ef794ba6 26 #include "HTTPClient.h"
ansond 30:bf56ef794ba6 27
ansond 30:bf56ef794ba6 28 class HTTPTransport : public Transport {
ansond 37:1588ba3af6d1 29 protected:
ansond 30:bf56ef794ba6 30 HTTPClient *m_http;
ansond 37:1588ba3af6d1 31
ansond 30:bf56ef794ba6 32 public:
ansond 30:bf56ef794ba6 33 HTTPTransport(ErrorHandler *error_handler,void *endpoint);
ansond 30:bf56ef794ba6 34 virtual ~HTTPTransport();
ansond 30:bf56ef794ba6 35
ansond 37:1588ba3af6d1 36 virtual bool httpGet(char *url,char *result,int result_length);
ansond 37:1588ba3af6d1 37 virtual bool httpPut(char *url,char *data,int data_length,char *result,int result_length);
ansond 37:1588ba3af6d1 38 virtual bool httpPost(char *url,char *data,int data_length,char *result,int result_length);
ansond 37:1588ba3af6d1 39 virtual bool httpDelete(char *url,char *data,int data_length);
ansond 37:1588ba3af6d1 40 };
ansond 30:bf56ef794ba6 41
ansond 37:1588ba3af6d1 42 #endif // _HTTP_TRANSPORT_H_