wrapper of TLS library to connect to HTTPS servers

Dependents:   HTTPSClientExample

This library provides a simple interface to send GET requests over HTTPS. Notice that this library uses the axTLS library for the implementation of TLS.

Import programHTTPSClientExample

Connect to twitter.com and copies this webpage to a file.

HTTPSClient.h

Committer:
feb11
Date:
2013-09-04
Revision:
0:ab9011f6ede5
Child:
2:6d7bc51cc77b

File content as of revision 0:ab9011f6ede5:

#ifndef HTTPS_CLIENT_H
#define HTTPS_CLIENT_H

#include <string>
#include "TLSConnection.h"
#include "HTTPStatus.h"
#include "HTTPHeader.h"

class HTTPSClient
{
    public :
    
        HTTPSClient();
        
        bool connect(const std::string& host);
        int get(const std::string& path, HTTPHeader *hdr);
        int get(const std::string& path, HTTPHeader *hdr, char *data, int length);
        bool disconnect();
        
    private :
    
        std::string readLine();
        HTTPHeader readHeader();
    
        TLSConnection _con;

};

#endif