API Gatewayクラス. [詳細]
#include "necbaas/nb_api_gateway.h"
| Public メソッド | |
| NbApiGateway (const std::shared_ptr< NbService > &service, const std::string &api_name, NbHttpRequestMethod http_method, const std::string &subpath="") | |
| コンストラクタ.  [詳細] | |
| ~NbApiGateway () | |
| デストラクタ.  [詳細] | |
| NbResult< NbHttpResponse > | ExecuteCustomApi (const std::string &body="") | 
| カスタムAPI実行.  [詳細] | |
| NbResult< NbHttpResponse > | ExecuteCustomApi (const std::vector< char > &body) | 
| カスタムAPI実行.  [詳細] | |
| int | GetTimeout () const | 
| RESTタイムアウト取得.  [詳細] | |
| void | SetTimeout (int timeout) | 
| RESTタイムアウト設定.  [詳細] | |
| const std::multimap < std::string, std::string > & | GetHeaders () const | 
| HTTPヘッダリスト取得.  [詳細] | |
| void | AddHeader (const std::string &name, const std::string &value) | 
| HTTPヘッダ追加.  [詳細] | |
| int | RemoveHeader (const std::string &name) | 
| HTTPヘッダ削除.  [詳細] | |
| void | ClearHeaders () | 
| HTTPヘッダクリア.  [詳細] | |
| const std::multimap < std::string, std::string > & | GetParameters () const | 
| リクエストパラメータリスト取得.  [詳細] | |
| void | AddParameter (const std::string &name, const std::string &value) | 
| リクエストパラメータ追加.  [詳細] | |
| int | RemoveParameter (const std::string &name) | 
| リクエストパラメータ削除.  [詳細] | |
| void | ClearParameters () | 
| リクエストパラメータクリア.  [詳細] | |
| const std::string & | GetContentType () const | 
| Content-Type取得.  [詳細] | |
| void | SetContentType (const std::string &content_type) | 
| Content-Type設定.  [詳細] | |
API Gatewayクラス.
本クラスのインスタンスはスレッドセーフではない
| necbaas::NbApiGateway::NbApiGateway | ( | const std::shared_ptr< NbService > & | service, | 
| const std::string & | api_name, | ||
| NbHttpRequestMethod | http_method, | ||
| const std::string & | subpath = "" | ||
| ) | 
コンストラクタ.
| [in] | service | サービスインスタンス | 
| [in] | api_name | api-name | 
| [in] | http_method | HTTPメソッド | 
| [in] | subpath | subpath(空文字:設定しない) | 
| necbaas::NbApiGateway::~NbApiGateway | ( | ) | 
デストラクタ.
| void necbaas::NbApiGateway::AddHeader | ( | const std::string & | name, | 
| const std::string & | value | ||
| ) | 
HTTPヘッダ追加.
HTTPヘッダ情報を追加する。
 Content-Typeは、SetContentType()を使用すること。
 以下のヘッダ名は、本メソッドで設定しても無視される。
User-Agentは、1つのみ設定可能。2つ目以降は上書きされる。
 ヘッダ名、ヘッダ値のいずれかが空文字の場合は追加しない。 
| [in] | name | ヘッダ名 | 
| [in] | value | ヘッダ値 | 
| void necbaas::NbApiGateway::AddParameter | ( | const std::string & | name, | 
| const std::string & | value | ||
| ) | 
リクエストパラメータ追加.
リクエストパラメータ情報を追加する。
 パラメータ名、パラメータ値のいずれかが空文字の場合は追加しない。
 POST, PUTメソッドの場合は、無視される。 
| [in] | name | パラメータ名 | 
| [in] | value | パラメータ値 | 
| void necbaas::NbApiGateway::ClearHeaders | ( | ) | 
HTTPヘッダクリア.
HTTPヘッダ情報を全削除する。
| void necbaas::NbApiGateway::ClearParameters | ( | ) | 
リクエストパラメータクリア.
リクエストパラメータ情報を全削除する。
| NbResult<NbHttpResponse> necbaas::NbApiGateway::ExecuteCustomApi | ( | const std::string & | body = "" | ) | 
カスタムAPI実行.
文字列Body付きのカスタムAPIを実行する。
 設定されたapi-nameが空文字の場合は、API名エラーを返す。
 空文字が設定された場合はBodyなしとして実行する。
 GET,DELETEメソッドの場合、Bodyは無視される。 
| [in] | body | Bodyデータ(文字列) | 
| NbResult<NbHttpResponse> necbaas::NbApiGateway::ExecuteCustomApi | ( | const std::vector< char > & | body | ) | 
カスタムAPI実行.
バイナリBody付きのカスタムAPIを実行する。
 設定されたapi-nameが空文字の場合は、API名エラーを返す。
 Bodyが空の場合は、Bodyなしとして実行する。
 GET,DELETEメソッドの場合、Bodyは無視される。 
| [in] | body | Bodyデータ(バイナリ) | 
| const std::string& necbaas::NbApiGateway::GetContentType | ( | ) | const | 
Content-Type取得.
| const std::multimap<std::string, std::string>& necbaas::NbApiGateway::GetHeaders | ( | ) | const | 
HTTPヘッダリスト取得.
| const std::multimap<std::string, std::string>& necbaas::NbApiGateway::GetParameters | ( | ) | const | 
リクエストパラメータリスト取得.
| int necbaas::NbApiGateway::GetTimeout | ( | ) | const | 
RESTタイムアウト取得.
| int necbaas::NbApiGateway::RemoveHeader | ( | const std::string & | name | ) | 
HTTPヘッダ削除.
HTTPヘッダ情報を削除する。
 ヘッダ名が空文字の場合は処理しない。 
| [in] | name | ヘッダ名 | 
| int necbaas::NbApiGateway::RemoveParameter | ( | const std::string & | name | ) | 
リクエストパラメータ削除.
リクエストパラメータ情報を削除する。
 リクエストパラメータ名が空文字の場合は処理しない。 
| [in] | name | パラメータ名 | 
| void necbaas::NbApiGateway::SetContentType | ( | const std::string & | content_type | ) | 
Content-Type設定.
Bodyの設定がない場合は、無視される。
| [in] | content_type | Content-Type | 
| void necbaas::NbApiGateway::SetTimeout | ( | int | timeout | ) | 
RESTタイムアウト設定.
RESTのタイムアウト値(秒)を設定する。
 0以下の値が設定された場合は、デフォルト値(60秒)が設定される。 
| [in] | timeout | タイムアウト(秒) | 
 1.8.5
 1.8.5