GDP group 24 node core

Dependencies:   EthernetInterface SDFileSystem mbed-rtos mbed snail MbedJSONValue

http.h

Committer:
Trumple
Date:
2015-01-28
Revision:
27:61e67ab47da5
Parent:
2:1cbb20dd1733

File content as of revision 27:61e67ab47da5:

#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);
};