[136] | 1 | /*
|
---|
| 2 | Copyright (c) 2013-2014 Arduino LLC. All right reserved.
|
---|
| 3 |
|
---|
| 4 | This library is free software; you can redistribute it and/or
|
---|
| 5 | modify it under the terms of the GNU Lesser General Public
|
---|
| 6 | License as published by the Free Software Foundation; either
|
---|
| 7 | version 2.1 of the License, or (at your option) any later version.
|
---|
| 8 |
|
---|
| 9 | This library is distributed in the hope that it will be useful,
|
---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 12 | Lesser General Public License for more details.
|
---|
| 13 |
|
---|
| 14 | You should have received a copy of the GNU Lesser General Public
|
---|
| 15 | License along with this library; if not, write to the Free Software
|
---|
| 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
| 17 | */
|
---|
| 18 |
|
---|
| 19 | #ifndef HTTPCLIENT_H_
|
---|
| 20 | #define HTTPCLIENT_H_
|
---|
| 21 |
|
---|
| 22 | #include <Process.h>
|
---|
| 23 |
|
---|
| 24 | class HttpClient : public Process {
|
---|
| 25 | public:
|
---|
| 26 | HttpClient();
|
---|
| 27 |
|
---|
| 28 | unsigned int get(String &url);
|
---|
| 29 | unsigned int get(const char * url);
|
---|
| 30 | void getAsynchronously(String &url);
|
---|
| 31 | void getAsynchronously(const char * url);
|
---|
| 32 | unsigned int post(String &url, String &data);
|
---|
| 33 | unsigned int post(const char * url, const char * data);
|
---|
| 34 | void postAsynchronously(String &url, String &data);
|
---|
| 35 | void postAsynchronously(const char * url, const char * data);
|
---|
| 36 | void setHeader(String &header);
|
---|
| 37 | void setHeader(const char * header);
|
---|
| 38 | boolean ready();
|
---|
| 39 | unsigned int getResult();
|
---|
| 40 | void noCheckSSL();
|
---|
| 41 | void checkSSL();
|
---|
| 42 |
|
---|
| 43 | private:
|
---|
| 44 | boolean insecure;
|
---|
| 45 |
|
---|
| 46 | private:
|
---|
| 47 | void addHeader();
|
---|
| 48 | String header;
|
---|
| 49 | };
|
---|
| 50 |
|
---|
| 51 | #endif /* HTTPCLIENT_H_ */
|
---|