GDP group 24 node core

Dependencies:   EthernetInterface SDFileSystem mbed-rtos mbed snail MbedJSONValue

http.h

Committer:
Trumple
Date:
2015-01-28
Revision:
31:9cf3f1e5ad68
Parent:
27:61e67ab47da5

File content as of revision 31:9cf3f1e5ad68:

#include "mbed.h"
#include "EthernetInterface.h"
#include <string>

#define DEBUG

class http
{
    public:
        string get(string address, int port, string url, int replyTimeout = 20);
        string post(string address, int port, string url, string jsonPayload, int replyTimeout = 20);
        string parse(string httpReply);
        bool isEthernetConnected();
        void connect();
    
    private:
        EthernetInterface eth;
        string receiveFromSock(TCPSocketConnection sock, int replyTimeout);
};