OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::HTTPResponse Class Reference

HTTP レスポンス More...

#include <HTTPResponse.hpp>

Public Member Functions

SIV3D_NODISCARD_CXX20 HTTPResponse ()=default
 デフォルトコンストラクタ More...
 
SIV3D_NODISCARD_CXX20 HTTPResponse (const std::string &response)
 HTTP レスポンスからステータスとヘッダを取得します。 More...
 
HTTPStatusCode getStatusCode () const noexcept
 ステータスコードを返します。 More...
 
const StringgetStatusLine () const noexcept
 ステータス行を返します。 More...
 
const StringgetHeader () const noexcept
 ヘッダーを返します。 More...
 
 operator bool () const noexcept
 有効な HTTP レスポンスであるかを返します。 More...
 
bool isInvalid () const noexcept
 無効な HTTP レスポンスであるかを返します。 More...
 
bool isInformational () const noexcept
 ステータスコードが 1xx (情報レスポンス) であるかを返します。 More...
 
bool isSuccessful () const noexcept
 ステータスコードが 2xx (成功レスポンス) であるかを返します。 More...
 
bool isRedirection () const noexcept
 ステータスコードが 3xx (リダイレクト) であるかを返します。 More...
 
bool isClientError () const noexcept
 ステータスコードが 4xx (クライアントエラー) であるかを返します。 More...
 
bool isServerError () const noexcept
 ステータスコードが 5xx (サーバエラー) であるかを返します。 More...
 
bool isOK () const noexcept
 ステータスコードが 200 (OK) であるかを返します。 More...
 
bool isNotFound () const noexcept
 ステータスコードが 404 (NotFound) であるかを返します。 More...
 

Detailed Description

HTTP レスポンス

Constructor & Destructor Documentation

◆ HTTPResponse() [1/2]

SIV3D_NODISCARD_CXX20 s3d::HTTPResponse::HTTPResponse ( )
default

デフォルトコンストラクタ

Remarks
無効な HTTP レスポンスを作成します。

◆ HTTPResponse() [2/2]

SIV3D_NODISCARD_CXX20 s3d::HTTPResponse::HTTPResponse ( const std::string &  response)
explicit

HTTP レスポンスからステータスとヘッダを取得します。

Parameters
responseHTTP レスポンス

Member Function Documentation

◆ getHeader()

const String& s3d::HTTPResponse::getHeader ( ) const
noexcept

ヘッダーを返します。

Returns
ヘッダー

◆ getStatusCode()

HTTPStatusCode s3d::HTTPResponse::getStatusCode ( ) const
noexcept

ステータスコードを返します。

Returns
ステータスコード

◆ getStatusLine()

const String& s3d::HTTPResponse::getStatusLine ( ) const
noexcept

ステータス行を返します。

Returns
ステータス行

◆ isClientError()

bool s3d::HTTPResponse::isClientError ( ) const
noexcept

ステータスコードが 4xx (クライアントエラー) であるかを返します。

Returns
ステータスコードが 4xx (クライアントエラー) である場合 true, それ以外の場合は false

◆ isInformational()

bool s3d::HTTPResponse::isInformational ( ) const
noexcept

ステータスコードが 1xx (情報レスポンス) であるかを返します。

Returns
ステータスコードが 1xx (情報レスポンス) である場合 true, それ以外の場合は false

◆ isInvalid()

bool s3d::HTTPResponse::isInvalid ( ) const
noexcept

無効な HTTP レスポンスであるかを返します。

Returns
無効な HTTP レスポンスである場合 true, それ以外の場合は false

◆ isNotFound()

bool s3d::HTTPResponse::isNotFound ( ) const
noexcept

ステータスコードが 404 (NotFound) であるかを返します。

Returns
ステータスコードが 404 (NotFound) である場合 true, それ以外の場合は false

◆ isOK()

bool s3d::HTTPResponse::isOK ( ) const
noexcept

ステータスコードが 200 (OK) であるかを返します。

Returns
ステータスコードが 200 (OK) である場合 true, それ以外の場合は false

◆ isRedirection()

bool s3d::HTTPResponse::isRedirection ( ) const
noexcept

ステータスコードが 3xx (リダイレクト) であるかを返します。

Returns
ステータスコードが 3xx (リダイレクト) である場合 true, それ以外の場合は false

◆ isServerError()

bool s3d::HTTPResponse::isServerError ( ) const
noexcept

ステータスコードが 5xx (サーバエラー) であるかを返します。

Returns
ステータスコードが 5xx (サーバエラー) である場合 true, それ以外の場合は false

◆ isSuccessful()

bool s3d::HTTPResponse::isSuccessful ( ) const
noexcept

ステータスコードが 2xx (成功レスポンス) であるかを返します。

Returns
ステータスコードが 2xx (成功レスポンス) である場合 true, それ以外の場合は false

◆ operator bool()

s3d::HTTPResponse::operator bool ( ) const
explicitnoexcept

有効な HTTP レスポンスであるかを返します。

Returns
有効な HTTP レスポンスである場合 true, それ以外の場合は false

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