VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
HttpResult.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <functional>
4
#include <string>
5
6
namespace
VoltMod
7
{
8
9
/** How an HTTP request ended. */
10
struct
HttpResult
11
{
12
bool
Ok
=
false
;
///< the server answered, with any status; when false, Error says why
13
long
StatusCode
= 0;
14
std::string
Body
;
15
std::string
Error
;
16
17
/** The server answered with a 2xx status. */
18
bool
IsSuccess
()
const
{
return
Ok
&&
StatusCode
>= 200 &&
StatusCode
< 300; }
19
};
20
21
using
HttpCompletion
= std::function<
void
(
const
HttpResult
&)>;
22
23
}
// namespace VoltMod
VoltMod
Definition
Options.hpp:13
VoltMod::ReadFile
static std::string ReadFile(const std::filesystem::path &path)
Definition
Loader.cpp:56
VoltMod::HttpCompletion
std::function< void(const HttpResult &)> HttpCompletion
Definition
HttpResult.hpp:21
VoltMod::HttpResult
Definition
HttpResult.hpp:11
VoltMod::HttpResult::Ok
bool Ok
the server answered, with any status; when false, Error says why
Definition
HttpResult.hpp:12
VoltMod::HttpResult::Body
std::string Body
Definition
HttpResult.hpp:14
VoltMod::HttpResult::IsSuccess
bool IsSuccess() const
Definition
HttpResult.hpp:18
VoltMod::HttpResult::StatusCode
long StatusCode
Definition
HttpResult.hpp:13
VoltMod::HttpResult::Error
std::string Error
Definition
HttpResult.hpp:15
include
VoltMod
Http
HttpResult.hpp
Generated by
1.9.8