HTTPSClient tutorial?

Please post support and help requests here.
Posts: 1
Joined: 26 Jan 2014, 04:57

HTTPSClient tutorial?

Postby proteneer » 26 Jan 2014, 05:01

OK I've been struggling with HTTPSClient for a while. Do I need to use a context? If I don't pass in a context I just get an illegal state error:

Code: Select all

#include <iostream>
#include <Poco/Net/HTTPSClientSession.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
#include <Poco/URI.h>
#include <Poco/Crypto/OpenSSLInitializer.h>
#include <Poco/Net/Context.h>

using namespace std;
using namespace Poco::Net;
using namespace Poco;

int main() {


    try {
        HTTPSClientSession session("", 443); // throws Illegal state

        HTTPRequest request("GET", "/");
        HTTPResponse response;
        cout << response.getStatus() << endl;
    } catch(exception &e) {
        cout << e.what() << endl;


Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests