You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
downloadclient/test_https.cc

34 lines
653 B

4 years ago
// this file is under GNU General Public License 3.0
// see LICENSE.txt
#include <iostream>
#include <assert.h>
#include "HTTPSStream.hh"
using namespace std;
using namespace pEp;
int main()
{
4 years ago
HTTPSDevice https;
https.open("https://pep.foundation");
https.get("/");
4 years ago
for (auto f=https.header().begin(); f != https.header().end(); ++f) {
cout << f->name_string() << ": " << f->value() << "\n";
}
4 years ago
https.close();
4 years ago
4 years ago
HTTPSStream httpss { HTTPSDevice { "https://pep.foundation" }, std::ios::binary };
httpss->get("/");
4 years ago
4 years ago
std::stringstream str;
str << httpss.rdbuf();
cout << str.str();
4 years ago
return 0;
}