Common: Add HttpRequest to simplify HTTP requests

Too much boilerplate that is duplicated if we use curl directly.
Let's add a simple wrapper class that hides the implementation details
and just allows to simply make HTTP requests and get responses.
This commit is contained in:
Léo Lam
2017-06-12 17:17:05 +02:00
parent 77c0539b5e
commit 18678afa6d
8 changed files with 170 additions and 79 deletions

View File

@ -11,12 +11,11 @@
#include <utility>
#include <vector>
#include <curl/curl.h>
#include "Common/CommonTypes.h"
#include "Common/Event.h"
#include "Common/FifoQueue.h"
#include "Common/Flag.h"
#include "Common/HttpRequest.h"
// Utilities for analytics reporting in Dolphin. This reporting is designed to
// provide anonymous data about how well Dolphin performs in the wild. It also
@ -179,7 +178,8 @@ public:
void Send(std::string report) override;
protected:
CURL* m_curl = nullptr;
std::string m_endpoint;
HttpRequest m_http;
};
} // namespace Common