mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Common/HttpRequest: Add option to allow non 200 response codes
This commit is contained in:
@ -19,6 +19,12 @@ namespace Common
|
||||
class HttpRequest final
|
||||
{
|
||||
public:
|
||||
enum class AllowedReturnCodes : u8
|
||||
{
|
||||
Ok_Only,
|
||||
All
|
||||
};
|
||||
|
||||
// Return false to abort the request
|
||||
using ProgressCallback =
|
||||
std::function<bool(double dlnow, double dltotal, double ulnow, double ultotal)>;
|
||||
@ -35,10 +41,12 @@ public:
|
||||
void UseIPv4();
|
||||
void FollowRedirects(long max = 1);
|
||||
std::string EscapeComponent(const std::string& string);
|
||||
Response Get(const std::string& url, const Headers& headers = {});
|
||||
Response Post(const std::string& url, const std::vector<u8>& payload,
|
||||
const Headers& headers = {});
|
||||
Response Post(const std::string& url, const std::string& payload, const Headers& headers = {});
|
||||
Response Get(const std::string& url, const Headers& headers = {},
|
||||
AllowedReturnCodes codes = AllowedReturnCodes::Ok_Only);
|
||||
Response Post(const std::string& url, const std::vector<u8>& payload, const Headers& headers = {},
|
||||
AllowedReturnCodes codes = AllowedReturnCodes::Ok_Only);
|
||||
Response Post(const std::string& url, const std::string& payload, const Headers& headers = {},
|
||||
AllowedReturnCodes codes = AllowedReturnCodes::Ok_Only);
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
|
Reference in New Issue
Block a user