Small wrapper of TLS_cyassl
Dependents: HTTPSClientExample2
This is a small wrapper of TLS_cyassl to easily sends GET requests over HTTPS. This library is used in the same way as HTTPSClient_axTLS.
Import programHTTPSClientExample2
This example shows how to use the TLS_cyassl library. It connects to twitter.com and downloads a webpage.
HTTPHeader.h@0:1abc65a0f50b, 2013-09-16 (annotated)
- Committer:
- feb11
- Date:
- Mon Sep 16 10:39:01 2013 +0000
- Revision:
- 0:1abc65a0f50b
initial import
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
feb11 | 0:1abc65a0f50b | 1 | #ifndef HTTP_HEADER_H |
feb11 | 0:1abc65a0f50b | 2 | #define HTTP_HEADER_H |
feb11 | 0:1abc65a0f50b | 3 | |
feb11 | 0:1abc65a0f50b | 4 | #include <string> |
feb11 | 0:1abc65a0f50b | 5 | #include "HTTPStatus.h" |
feb11 | 0:1abc65a0f50b | 6 | |
feb11 | 0:1abc65a0f50b | 7 | class HTTPSClient; |
feb11 | 0:1abc65a0f50b | 8 | |
feb11 | 0:1abc65a0f50b | 9 | class HTTPHeader |
feb11 | 0:1abc65a0f50b | 10 | { |
feb11 | 0:1abc65a0f50b | 11 | public : |
feb11 | 0:1abc65a0f50b | 12 | |
feb11 | 0:1abc65a0f50b | 13 | friend class HTTPSClient; |
feb11 | 0:1abc65a0f50b | 14 | |
feb11 | 0:1abc65a0f50b | 15 | HTTPHeader(HTTPStatus status = HTTP_INVALID); |
feb11 | 0:1abc65a0f50b | 16 | |
feb11 | 0:1abc65a0f50b | 17 | static std::string getRequest(const std::string &path, const std::string &host, const int port); |
feb11 | 0:1abc65a0f50b | 18 | |
feb11 | 0:1abc65a0f50b | 19 | HTTPStatus getStatus() const; |
feb11 | 0:1abc65a0f50b | 20 | int getBodyLength() const; |
feb11 | 0:1abc65a0f50b | 21 | private : |
feb11 | 0:1abc65a0f50b | 22 | |
feb11 | 0:1abc65a0f50b | 23 | HTTPStatus _status; |
feb11 | 0:1abc65a0f50b | 24 | int _bodyLength; |
feb11 | 0:1abc65a0f50b | 25 | }; |
feb11 | 0:1abc65a0f50b | 26 | |
feb11 | 0:1abc65a0f50b | 27 | #endif |
feb11 | 0:1abc65a0f50b | 28 |