11#ifndef OCTANE_API_CLIENT_INTERNAL_FETCH_H_
12#define OCTANE_API_CLIENT_INTERNAL_FETCH_H_
14#include <rapidjson/document.h>
15#include <rapidjson/encodings.h>
16#include <rapidjson/stringbuffer.h>
17#include <rapidjson/writer.h>
36 std::variant<rapidjson::Document, std::vector<std::uint8_t>>
body;
44 std::map<std::string,std::string>
header;
108 std::string_view url,
109 const rapidjson::Document& body)
132 std::string_view url,
133 std::string_view mimeType,
134 const std::vector<std::uint8_t>& body)
170 Fetch(std::string_view token,
171 std::string_view origin,
172 std::string_view baseUrl,
174 virtual ~Fetch()
noexcept;
183 std::string_view url)
override;
188 std::string_view url,
189 const rapidjson::Document& body)
override;
194 std::string_view url,
195 std::string_view mimeType,
196 const std::vector<std::uint8_t>& body)
override;
223 std::string_view origin,
224 std::string_view url,
225 const std::map<std::string, std::string>& headers,
226 const std::vector<std::uint8_t>& body);
Wrapper class that bifurcates the values indicated by normal and quasi-normal states.
Definition: result.h:38
HttpClientクラスを通じてHTTP通信を行うインタフェース。
Definition: fetch.h:55
virtual ~FetchBase() noexcept=0
Definition: fetch.cpp:21
virtual FetchResult request(HttpMethod method, std::string_view url)=0
APIへのボディ部を持たないリクエストを発行する。
virtual Result< _, ErrorResponse > init()=0
Fetchのインスタンスを初期化する。
HttpClientクラスを通じてHTTP通信を行う。
Definition: fetch.h:144
HTTP通信を行うインタフェース。
Definition: http_client.h:120
Definition: api_bridge.cpp:25
HttpMethod
HTTPメソッドを表す列挙体。
Definition: http_client.h:28
Define type to represent the result, inspired by Rust's "Result".
Structure representing that it returns nothing.
Definition: result.h:222
General stucture to represent the error.
Definition: error_response.h:24
Fetchのレスポンスを表す構造体。
Definition: fetch.h:34
std::string statusLine
レスポンスのステータスライン。
Definition: fetch.h:42
std::map< std::string, std::string > header
レスポンスのヘッダ部(ステータスラインを除く)。
Definition: fetch.h:44
std::string mime
レスポンスのmime。
Definition: fetch.h:38
int statusCode
レスポンスのステータスコード。
Definition: fetch.h:40
std::variant< rapidjson::Document, std::vector< std::uint8_t > > body
レスポンスのボディ部。
Definition: fetch.h:36