libLicenseClient/api/HTTPClient.h
2018-03-27 23:03:06 +02:00

25 lines
627 B
C++

#pragma once
#include <string>
#include <ostream>
class CouldNotConnectException : public std::exception
{
public:
CouldNotConnectException()
{}
virtual ~CouldNotConnectException() throw () {}
};
class HTTPClient
{
public:
HTTPClient();
public:
void get(const std::string& url, std::ostream& dstStream) throw (CouldNotConnectException);
void postJson(const std::string& url, std::istream& json, size_t length, std::ostream& dstStream) throw (CouldNotConnectException);
void postJson(const std::string& url, const std::string& json, std::ostream& dstStream) throw (CouldNotConnectException);
};