NetServices Stack source
Dependents: HelloWorld ServoInterfaceBoardExample1 4180_Lab4
services/http/client/HTTPClient.h@5:dd63a1e02b1b, 2010-07-27 (annotated)
- Committer:
- donatien
- Date:
- Tue Jul 27 15:59:42 2010 +0000
- Revision:
- 5:dd63a1e02b1b
- Parent:
- 0:632c9925f013
- Child:
- 6:b7dd7cde8ad2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 0:632c9925f013 | 1 | |
donatien | 0:632c9925f013 | 2 | /* |
donatien | 0:632c9925f013 | 3 | Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com) |
donatien | 0:632c9925f013 | 4 | |
donatien | 0:632c9925f013 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy |
donatien | 0:632c9925f013 | 6 | of this software and associated documentation files (the "Software"), to deal |
donatien | 0:632c9925f013 | 7 | in the Software without restriction, including without limitation the rights |
donatien | 0:632c9925f013 | 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
donatien | 0:632c9925f013 | 9 | copies of the Software, and to permit persons to whom the Software is |
donatien | 0:632c9925f013 | 10 | furnished to do so, subject to the following conditions: |
donatien | 0:632c9925f013 | 11 | |
donatien | 0:632c9925f013 | 12 | The above copyright notice and this permission notice shall be included in |
donatien | 0:632c9925f013 | 13 | all copies or substantial portions of the Software. |
donatien | 0:632c9925f013 | 14 | |
donatien | 0:632c9925f013 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
donatien | 0:632c9925f013 | 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
donatien | 0:632c9925f013 | 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
donatien | 0:632c9925f013 | 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
donatien | 0:632c9925f013 | 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
donatien | 0:632c9925f013 | 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
donatien | 0:632c9925f013 | 21 | THE SOFTWARE. |
donatien | 0:632c9925f013 | 22 | */ |
donatien | 0:632c9925f013 | 23 | |
donatien | 0:632c9925f013 | 24 | #ifndef HTTP_CLIENT_H |
donatien | 0:632c9925f013 | 25 | #define HTTP_CLIENT_H |
donatien | 0:632c9925f013 | 26 | |
donatien | 0:632c9925f013 | 27 | class HTTPData; |
donatien | 0:632c9925f013 | 28 | |
donatien | 0:632c9925f013 | 29 | #include "if/net/net.h" |
donatien | 0:632c9925f013 | 30 | #include "api/TCPSocket.h" |
donatien | 0:632c9925f013 | 31 | #include "api/DNSRequest.h" |
donatien | 0:632c9925f013 | 32 | #include "HTTPData.h" |
donatien | 0:632c9925f013 | 33 | #include "mbed.h" |
donatien | 0:632c9925f013 | 34 | |
donatien | 0:632c9925f013 | 35 | #include <string> |
donatien | 0:632c9925f013 | 36 | using std::string; |
donatien | 0:632c9925f013 | 37 | |
donatien | 0:632c9925f013 | 38 | #include <map> |
donatien | 0:632c9925f013 | 39 | using std::map; |
donatien | 0:632c9925f013 | 40 | |
donatien | 5:dd63a1e02b1b | 41 | ///HTTP client results |
donatien | 0:632c9925f013 | 42 | enum HTTPResult |
donatien | 0:632c9925f013 | 43 | { |
donatien | 0:632c9925f013 | 44 | HTTP_OK, |
donatien | 0:632c9925f013 | 45 | HTTP_PROCESSING, |
donatien | 5:dd63a1e02b1b | 46 | HTTP_PARSE, ///URI Parse error |
donatien | 5:dd63a1e02b1b | 47 | HTTP_DNS, ///Could not resolve name |
donatien | 5:dd63a1e02b1b | 48 | HTTP_PRTCL, ///Protocol error |
donatien | 5:dd63a1e02b1b | 49 | HTTP_NOTFOUND, ///HTTP 404 Error |
donatien | 5:dd63a1e02b1b | 50 | HTTP_REFUSED, ///HTTP 403 Error |
donatien | 5:dd63a1e02b1b | 51 | HTTP_ERROR, ///HTTP xxx error |
donatien | 5:dd63a1e02b1b | 52 | HTTP_TIMEOUT, ///Connection timeout |
donatien | 5:dd63a1e02b1b | 53 | HTTP_CONN ///Connection error |
donatien | 0:632c9925f013 | 54 | }; |
donatien | 0:632c9925f013 | 55 | |
donatien | 5:dd63a1e02b1b | 56 | ///A simple HTTP Client |
donatien | 5:dd63a1e02b1b | 57 | /** |
donatien | 5:dd63a1e02b1b | 58 | The HTTPClient is composed of: |
donatien | 5:dd63a1e02b1b | 59 | - The actual client (HTTPClient) |
donatien | 5:dd63a1e02b1b | 60 | - Classes that act as a data repository, each of which deriving from the HTTPData class (HTTPText for short text content, HTTPFile for file I/O, HTTPMap for key/value pairs, and HTTPStream for streaming purposes) |
donatien | 5:dd63a1e02b1b | 61 | */ |
donatien | 0:632c9925f013 | 62 | class HTTPClient : protected NetService |
donatien | 0:632c9925f013 | 63 | { |
donatien | 0:632c9925f013 | 64 | public: |
donatien | 5:dd63a1e02b1b | 65 | ///Instantiates the HTTP client |
donatien | 0:632c9925f013 | 66 | HTTPClient(); |
donatien | 0:632c9925f013 | 67 | virtual ~HTTPClient(); |
donatien | 0:632c9925f013 | 68 | |
donatien | 5:dd63a1e02b1b | 69 | ///Provides a basic authentification feature (Base64 encoded username and password) |
donatien | 0:632c9925f013 | 70 | void basicAuth(const char* user, const char* password); //Basic Authentification |
donatien | 0:632c9925f013 | 71 | |
donatien | 0:632c9925f013 | 72 | //High Level setup functions |
donatien | 5:dd63a1e02b1b | 73 | ///Executes a GET Request (blocking) |
donatien | 5:dd63a1e02b1b | 74 | /** |
donatien | 5:dd63a1e02b1b | 75 | Executes a GET request on the URI uri |
donatien | 5:dd63a1e02b1b | 76 | @param uri : URI on which to execute the request |
donatien | 5:dd63a1e02b1b | 77 | @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL |
donatien | 5:dd63a1e02b1b | 78 | Blocks until completion |
donatien | 5:dd63a1e02b1b | 79 | */ |
donatien | 0:632c9925f013 | 80 | HTTPResult get(const char* uri, HTTPData* pDataIn); //Blocking |
donatien | 5:dd63a1e02b1b | 81 | |
donatien | 5:dd63a1e02b1b | 82 | ///Executes a GET Request (non blocking) |
donatien | 5:dd63a1e02b1b | 83 | /** |
donatien | 5:dd63a1e02b1b | 84 | Executes a GET request on the URI uri |
donatien | 5:dd63a1e02b1b | 85 | @param uri : URI on which to execute the request |
donatien | 5:dd63a1e02b1b | 86 | @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL |
donatien | 5:dd63a1e02b1b | 87 | @param pMethod : callback function |
donatien | 5:dd63a1e02b1b | 88 | The function returns immediately and calls the callback on completion or error |
donatien | 5:dd63a1e02b1b | 89 | */ |
donatien | 0:632c9925f013 | 90 | HTTPResult get(const char* uri, HTTPData* pDataIn, void (*pMethod)(HTTPResult)); //Non blocking |
donatien | 5:dd63a1e02b1b | 91 | |
donatien | 5:dd63a1e02b1b | 92 | ///Executes a GET Request (non blocking) |
donatien | 5:dd63a1e02b1b | 93 | /** |
donatien | 5:dd63a1e02b1b | 94 | Executes a GET request on the URI uri |
donatien | 5:dd63a1e02b1b | 95 | @param uri : URI on which to execute the request |
donatien | 5:dd63a1e02b1b | 96 | @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL |
donatien | 5:dd63a1e02b1b | 97 | @param pItem : instance of class on which to execute the callback method |
donatien | 5:dd63a1e02b1b | 98 | @param pMethod : callback method |
donatien | 5:dd63a1e02b1b | 99 | The function returns immediately and calls the callback on completion or error |
donatien | 5:dd63a1e02b1b | 100 | */ |
donatien | 0:632c9925f013 | 101 | template<class T> |
donatien | 0:632c9925f013 | 102 | HTTPResult get(const char* uri, HTTPData* pDataIn, T* pItem, void (T::*pMethod)(HTTPResult)) //Non blocking |
donatien | 0:632c9925f013 | 103 | { |
donatien | 0:632c9925f013 | 104 | setOnResult(pItem, pMethod); |
donatien | 0:632c9925f013 | 105 | doGet(uri, pDataIn); |
donatien | 0:632c9925f013 | 106 | return HTTP_PROCESSING; |
donatien | 0:632c9925f013 | 107 | } |
donatien | 0:632c9925f013 | 108 | |
donatien | 5:dd63a1e02b1b | 109 | ///Executes a POST Request (blocking) |
donatien | 5:dd63a1e02b1b | 110 | /** |
donatien | 5:dd63a1e02b1b | 111 | Executes a POST request on the URI uri |
donatien | 5:dd63a1e02b1b | 112 | @param uri : URI on which to execute the request |
donatien | 5:dd63a1e02b1b | 113 | @param dataOut : a HTTPData instance that contains the data that will be posted |
donatien | 5:dd63a1e02b1b | 114 | @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL |
donatien | 5:dd63a1e02b1b | 115 | Blocks until completion |
donatien | 5:dd63a1e02b1b | 116 | */ |
donatien | 0:632c9925f013 | 117 | HTTPResult post(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn); //Blocking |
donatien | 5:dd63a1e02b1b | 118 | |
donatien | 5:dd63a1e02b1b | 119 | ///Executes a POST Request (non blocking) |
donatien | 5:dd63a1e02b1b | 120 | /** |
donatien | 5:dd63a1e02b1b | 121 | Executes a POST request on the URI uri |
donatien | 5:dd63a1e02b1b | 122 | @param uri : URI on which to execute the request |
donatien | 5:dd63a1e02b1b | 123 | @param dataOut : a HTTPData instance that contains the data that will be posted |
donatien | 5:dd63a1e02b1b | 124 | @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL |
donatien | 5:dd63a1e02b1b | 125 | @param pMethod : callback function |
donatien | 5:dd63a1e02b1b | 126 | The function returns immediately and calls the callback on completion or error |
donatien | 5:dd63a1e02b1b | 127 | */ |
donatien | 0:632c9925f013 | 128 | HTTPResult post(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn, void (*pMethod)(HTTPResult)); //Non blocking |
donatien | 5:dd63a1e02b1b | 129 | |
donatien | 5:dd63a1e02b1b | 130 | ///Executes a POST Request (non blocking) |
donatien | 5:dd63a1e02b1b | 131 | /** |
donatien | 5:dd63a1e02b1b | 132 | Executes a POST request on the URI uri |
donatien | 5:dd63a1e02b1b | 133 | @param uri : URI on which to execute the request |
donatien | 5:dd63a1e02b1b | 134 | @param dataOut : a HTTPData instance that contains the data that will be posted |
donatien | 5:dd63a1e02b1b | 135 | @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL |
donatien | 5:dd63a1e02b1b | 136 | @param pItem : instance of class on which to execute the callback method |
donatien | 5:dd63a1e02b1b | 137 | @param pMethod : callback method |
donatien | 5:dd63a1e02b1b | 138 | The function returns immediately and calls the callback on completion or error |
donatien | 5:dd63a1e02b1b | 139 | */ |
donatien | 0:632c9925f013 | 140 | template<class T> |
donatien | 0:632c9925f013 | 141 | HTTPResult post(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn, T* pItem, void (T::*pMethod)(HTTPResult)) //Non blocking |
donatien | 0:632c9925f013 | 142 | { |
donatien | 0:632c9925f013 | 143 | setOnResult(pItem, pMethod); |
donatien | 0:632c9925f013 | 144 | doPost(uri, dataOut, pDataIn); |
donatien | 0:632c9925f013 | 145 | return HTTP_PROCESSING; |
donatien | 0:632c9925f013 | 146 | } |
donatien | 5:dd63a1e02b1b | 147 | |
donatien | 5:dd63a1e02b1b | 148 | ///Executes a GET Request (non blocking) |
donatien | 5:dd63a1e02b1b | 149 | /** |
donatien | 5:dd63a1e02b1b | 150 | Executes a GET request on the URI uri |
donatien | 5:dd63a1e02b1b | 151 | @param uri : URI on which to execute the request |
donatien | 5:dd63a1e02b1b | 152 | @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL |
donatien | 5:dd63a1e02b1b | 153 | The function returns immediately and calls the previously set callback on completion or error |
donatien | 5:dd63a1e02b1b | 154 | */ |
donatien | 5:dd63a1e02b1b | 155 | void doGet(const char* uri, HTTPData* pDataIn); |
donatien | 0:632c9925f013 | 156 | |
donatien | 5:dd63a1e02b1b | 157 | ///Executes a POST Request (non blocking) |
donatien | 5:dd63a1e02b1b | 158 | /** |
donatien | 5:dd63a1e02b1b | 159 | Executes a POST request on the URI uri |
donatien | 5:dd63a1e02b1b | 160 | @param uri : URI on which to execute the request |
donatien | 5:dd63a1e02b1b | 161 | @param dataOut : a HTTPData instance that contains the data that will be posted |
donatien | 5:dd63a1e02b1b | 162 | @param pDataIn : pointer to an HTTPData instance that will collect the data returned by the request, can be NULL |
donatien | 5:dd63a1e02b1b | 163 | @param pMethod : callback function |
donatien | 5:dd63a1e02b1b | 164 | The function returns immediately and calls the previously set callback on completion or error |
donatien | 5:dd63a1e02b1b | 165 | */ |
donatien | 0:632c9925f013 | 166 | void doPost(const char* uri, const HTTPData& dataOut, HTTPData* pDataIn); |
donatien | 0:632c9925f013 | 167 | |
donatien | 5:dd63a1e02b1b | 168 | ///Setups the result callback |
donatien | 5:dd63a1e02b1b | 169 | /** |
donatien | 5:dd63a1e02b1b | 170 | @param pMethod : callback function |
donatien | 5:dd63a1e02b1b | 171 | */ |
donatien | 0:632c9925f013 | 172 | void setOnResult( void (*pMethod)(HTTPResult) ); |
donatien | 5:dd63a1e02b1b | 173 | |
donatien | 5:dd63a1e02b1b | 174 | ///Setups the result callback |
donatien | 5:dd63a1e02b1b | 175 | /** |
donatien | 5:dd63a1e02b1b | 176 | @param pItem : instance of class on which to execute the callback method |
donatien | 5:dd63a1e02b1b | 177 | @param pMethod : callback method |
donatien | 5:dd63a1e02b1b | 178 | */ |
donatien | 0:632c9925f013 | 179 | class CDummy; |
donatien | 0:632c9925f013 | 180 | template<class T> |
donatien | 0:632c9925f013 | 181 | void setOnResult( T* pItem, void (T::*pMethod)(HTTPResult) ) |
donatien | 0:632c9925f013 | 182 | { |
donatien | 0:632c9925f013 | 183 | m_pCb = NULL; |
donatien | 0:632c9925f013 | 184 | m_pCbItem = (CDummy*) pItem; |
donatien | 0:632c9925f013 | 185 | m_pCbMeth = (void (CDummy::*)(HTTPResult)) pMethod; |
donatien | 0:632c9925f013 | 186 | } |
donatien | 5:dd63a1e02b1b | 187 | |
donatien | 5:dd63a1e02b1b | 188 | ///Setups timeout |
donatien | 5:dd63a1e02b1b | 189 | /** |
donatien | 5:dd63a1e02b1b | 190 | @param ms : time of connection inactivity in ms after which the request should timeout |
donatien | 5:dd63a1e02b1b | 191 | */ |
donatien | 0:632c9925f013 | 192 | void setTimeout(int ms); |
donatien | 0:632c9925f013 | 193 | |
donatien | 0:632c9925f013 | 194 | virtual void poll(); //Called by NetServices |
donatien | 0:632c9925f013 | 195 | |
donatien | 5:dd63a1e02b1b | 196 | ///Gets last request's HTTP response code |
donatien | 5:dd63a1e02b1b | 197 | /** |
donatien | 5:dd63a1e02b1b | 198 | @return The HTTP response code of the last request |
donatien | 5:dd63a1e02b1b | 199 | */ |
donatien | 0:632c9925f013 | 200 | int getHTTPResponseCode(); |
donatien | 5:dd63a1e02b1b | 201 | |
donatien | 5:dd63a1e02b1b | 202 | ///Sets a specific request header |
donatien | 0:632c9925f013 | 203 | void setRequestHeader(const string& header, const string& value); |
donatien | 5:dd63a1e02b1b | 204 | |
donatien | 5:dd63a1e02b1b | 205 | ///Gets a response header |
donatien | 0:632c9925f013 | 206 | string& getResponseHeader(const string& header); |
donatien | 5:dd63a1e02b1b | 207 | |
donatien | 5:dd63a1e02b1b | 208 | ///Clears request headers |
donatien | 0:632c9925f013 | 209 | void resetRequestHeaders(); |
donatien | 0:632c9925f013 | 210 | |
donatien | 0:632c9925f013 | 211 | protected: |
donatien | 0:632c9925f013 | 212 | void resetTimeout(); |
donatien | 0:632c9925f013 | 213 | |
donatien | 0:632c9925f013 | 214 | void init(); |
donatien | 0:632c9925f013 | 215 | void close(); |
donatien | 0:632c9925f013 | 216 | |
donatien | 0:632c9925f013 | 217 | void setup(const char* uri, HTTPData* pDataOut, HTTPData* pDataIn); //Setup request, make DNS Req if necessary |
donatien | 0:632c9925f013 | 218 | void connect(); //Start Connection |
donatien | 0:632c9925f013 | 219 | |
donatien | 0:632c9925f013 | 220 | int tryRead(); //Read data and try to feed output |
donatien | 0:632c9925f013 | 221 | void readData(); //Data has been read |
donatien | 0:632c9925f013 | 222 | void writeData(); //Data has been written & buf is free |
donatien | 0:632c9925f013 | 223 | |
donatien | 0:632c9925f013 | 224 | void onTCPSocketEvent(TCPSocketEvent e); |
donatien | 0:632c9925f013 | 225 | void onDNSReply(DNSReply r); |
donatien | 0:632c9925f013 | 226 | void onResult(HTTPResult r); //Called when exchange completed or on failure |
donatien | 0:632c9925f013 | 227 | void onTimeout(); //Connection has timed out |
donatien | 0:632c9925f013 | 228 | |
donatien | 0:632c9925f013 | 229 | private: |
donatien | 0:632c9925f013 | 230 | HTTPResult blockingProcess(); //Called in blocking mode, calls Net::poll() until return code is available |
donatien | 0:632c9925f013 | 231 | |
donatien | 0:632c9925f013 | 232 | bool readHeaders(); //Called first when receiving data |
donatien | 0:632c9925f013 | 233 | bool writeHeaders(); //Called to create req |
donatien | 0:632c9925f013 | 234 | int readLine(char* str, int maxLen, bool* pIncomplete = NULL); |
donatien | 0:632c9925f013 | 235 | |
donatien | 0:632c9925f013 | 236 | enum HTTP_METH |
donatien | 0:632c9925f013 | 237 | { |
donatien | 0:632c9925f013 | 238 | HTTP_GET, |
donatien | 0:632c9925f013 | 239 | HTTP_POST, |
donatien | 0:632c9925f013 | 240 | HTTP_HEAD |
donatien | 0:632c9925f013 | 241 | }; |
donatien | 0:632c9925f013 | 242 | |
donatien | 0:632c9925f013 | 243 | HTTP_METH m_meth; |
donatien | 0:632c9925f013 | 244 | |
donatien | 0:632c9925f013 | 245 | CDummy* m_pCbItem; |
donatien | 0:632c9925f013 | 246 | void (CDummy::*m_pCbMeth)(HTTPResult); |
donatien | 0:632c9925f013 | 247 | |
donatien | 0:632c9925f013 | 248 | void (*m_pCb)(HTTPResult); |
donatien | 0:632c9925f013 | 249 | |
donatien | 0:632c9925f013 | 250 | TCPSocket* m_pTCPSocket; |
donatien | 0:632c9925f013 | 251 | map<string, string> m_reqHeaders; |
donatien | 0:632c9925f013 | 252 | map<string, string> m_respHeaders; |
donatien | 0:632c9925f013 | 253 | |
donatien | 0:632c9925f013 | 254 | Timer m_watchdog; |
donatien | 0:632c9925f013 | 255 | int m_timeout; |
donatien | 0:632c9925f013 | 256 | |
donatien | 0:632c9925f013 | 257 | DNSRequest* m_pDnsReq; |
donatien | 0:632c9925f013 | 258 | |
donatien | 0:632c9925f013 | 259 | Host m_server; |
donatien | 0:632c9925f013 | 260 | string m_path; |
donatien | 0:632c9925f013 | 261 | |
donatien | 0:632c9925f013 | 262 | bool m_closed; |
donatien | 0:632c9925f013 | 263 | |
donatien | 0:632c9925f013 | 264 | enum HTTPStep |
donatien | 0:632c9925f013 | 265 | { |
donatien | 0:632c9925f013 | 266 | // HTTP_INIT, |
donatien | 0:632c9925f013 | 267 | HTTP_WRITE_HEADERS, |
donatien | 0:632c9925f013 | 268 | HTTP_WRITE_DATA, |
donatien | 0:632c9925f013 | 269 | HTTP_READ_HEADERS, |
donatien | 0:632c9925f013 | 270 | HTTP_READ_DATA, |
donatien | 0:632c9925f013 | 271 | HTTP_READ_DATA_INCOMPLETE, |
donatien | 0:632c9925f013 | 272 | HTTP_DONE, |
donatien | 0:632c9925f013 | 273 | HTTP_CLOSED |
donatien | 0:632c9925f013 | 274 | }; |
donatien | 0:632c9925f013 | 275 | |
donatien | 0:632c9925f013 | 276 | HTTPStep m_state; |
donatien | 0:632c9925f013 | 277 | |
donatien | 0:632c9925f013 | 278 | HTTPData* m_pDataOut; |
donatien | 0:632c9925f013 | 279 | HTTPData* m_pDataIn; |
donatien | 0:632c9925f013 | 280 | |
donatien | 0:632c9925f013 | 281 | bool m_dataChunked; //Data is encoded as chunks |
donatien | 0:632c9925f013 | 282 | int m_dataPos; //Position in data |
donatien | 0:632c9925f013 | 283 | int m_dataLen; //Data length |
donatien | 0:632c9925f013 | 284 | char* m_buf; |
donatien | 0:632c9925f013 | 285 | char* m_pBufRemaining; //Remaining |
donatien | 0:632c9925f013 | 286 | int m_bufRemainingLen; //Data length in m_pBufRemaining |
donatien | 0:632c9925f013 | 287 | |
donatien | 0:632c9925f013 | 288 | int m_httpResponseCode; |
donatien | 0:632c9925f013 | 289 | |
donatien | 0:632c9925f013 | 290 | HTTPResult m_blockingResult; //Result if blocking mode |
donatien | 0:632c9925f013 | 291 | |
donatien | 0:632c9925f013 | 292 | }; |
donatien | 0:632c9925f013 | 293 | |
donatien | 0:632c9925f013 | 294 | //Including data containers here for more convenience |
donatien | 0:632c9925f013 | 295 | #include "data/HTTPFile.h" |
donatien | 0:632c9925f013 | 296 | #include "data/HTTPStream.h" |
donatien | 0:632c9925f013 | 297 | #include "data/HTTPText.h" |
donatien | 0:632c9925f013 | 298 | #include "data/HTTPMap.h" |
donatien | 0:632c9925f013 | 299 | |
donatien | 0:632c9925f013 | 300 | #endif |