Octane API Client
Loading...
Searching...
No Matches
Public Member Functions | List of all members
octane::internal::HttpClient Class Reference

HTTP通信を行う。 More...

#include <http_client.h>

Inheritance diagram for octane::internal::HttpClient:
Inheritance graph
[legend]
Collaboration diagram for octane::internal::HttpClient:
Collaboration graph
[legend]

Public Member Functions

virtual ~HttpClient () noexcept
 
virtual Result< _, ErrorResponseinit () noexcept override
 
virtual Result< HttpResponse, ErrorResponserequest (std::string_view origin, const HttpRequest &request) override
 
- Public Member Functions inherited from octane::internal::HttpClientBase
virtual ~HttpClientBase () noexcept=0
 
virtual Result< _, ErrorResponseinit () noexcept=0
 HttpClientを初期化する。 More...
 
virtual Result< HttpResponse, ErrorResponserequest (std::string_view origin, const HttpRequest &request)=0
 HTTPリクエストを発行する。 More...
 

Detailed Description

HTTP通信を行う。

Constructor & Destructor Documentation

◆ ~HttpClient()

octane::internal::HttpClient::~HttpClient ( )
virtualnoexcept

Member Function Documentation

◆ init()

Result< _, ErrorResponse > octane::internal::HttpClient::init ( )
overridevirtualnoexcept

HttpClientを初期化する。このメソッドはインスタンスを生成した直後に呼び出さなければならない。 また、複数回呼び出すことはできない。 失敗した場合は以下のエラーレスポンスを返す。

  • ERR_CURL_INITIALIZATION_FAILED: CURLの初期化に失敗したとき
Returns
Result<_, ErrorResponse> 成功した場合は何も返さず、失敗した場合は上記のエラーレスポンスを返す。

Implements octane::internal::HttpClientBase.

Here is the call graph for this function:

◆ request()

Result< HttpResponse, ErrorResponse > octane::internal::HttpClient::request ( std::string_view  origin,
const HttpRequest request 
)
overridevirtual

HTTPリクエストを発行する。失敗した場合は以下のエラーレスポンスを返す。

  • ERR_INCORRECT_HTTP_METHOD: GET, POST, PUT, DELETE以外のメソッドを使用したり、GET, DELETEでボディ部を指定したとき
  • ERR_CURL_CONNECTION_FAILED: CURLの接続に失敗したとき
Parameters
[in]originリクエスト先のオリジン。"http://localhost:3000"など。
[in]requestリクエスト用のオブジェクト。
Returns
Result<HttpResponse, ErrorResponse>

Implements octane::internal::HttpClientBase.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: