25 lines
528 B
C++
25 lines
528 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);
|
|
void postJson(const std::string& url, std::istream& json, size_t length, std::ostream& dstStream);
|
|
void postJson(const std::string& url, const std::string& json, std::ostream& dstStream);
|
|
};
|