2019-02-14 19:14:57 +01:00
|
|
|
/*
|
|
|
|
* IXHttpClient.h
|
|
|
|
* Author: Benjamin Sergeant
|
|
|
|
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <functional>
|
|
|
|
#include <mutex>
|
|
|
|
#include <atomic>
|
|
|
|
#include <tuple>
|
2019-02-15 05:11:42 +01:00
|
|
|
#include <memory>
|
2019-02-14 19:14:57 +01:00
|
|
|
|
|
|
|
#include "IXSocket.h"
|
|
|
|
#include "IXWebSocketHttpHeaders.h"
|
|
|
|
|
|
|
|
namespace ix
|
|
|
|
{
|
2019-02-15 05:11:42 +01:00
|
|
|
using HttpResponse = std::tuple<int, WebSocketHttpHeaders, std::string, std::string>;
|
2019-02-14 19:14:57 +01:00
|
|
|
|
|
|
|
class HttpClient {
|
|
|
|
public:
|
|
|
|
HttpClient();
|
|
|
|
~HttpClient();
|
|
|
|
|
|
|
|
// Static methods ?
|
2019-02-15 05:11:42 +01:00
|
|
|
HttpResponse get(const std::string& url, bool verbose);
|
2019-02-14 19:14:57 +01:00
|
|
|
|
|
|
|
private:
|
2019-02-15 05:11:42 +01:00
|
|
|
std::shared_ptr<Socket> _socket;
|
2019-02-14 19:14:57 +01:00
|
|
|
};
|
|
|
|
}
|