Interface IRequestClient
GraphQL / v1.1 の各エンドポイント層が必要とする、最小限のリクエスト機能。 Client と GuestClient の両方が実装します。
public interface IRequestClient
Properties
BaseHeaders
API リクエストの基本ヘッダー(呼び出しごとに新しい辞書)。
Dictionary<string, string> BaseHeaders { get; }
Property Value
Methods
GetAsync(string, RequestOptions?)
Task<ApiResponse> GetAsync(string url, RequestOptions? options = null)
Parameters
urlstringoptionsRequestOptions
Returns
GetCsrfToken()
Cookie 中の CSRF トークン(ct0)。無ければ null。
string? GetCsrfToken()
Returns
PostAsync(string, RequestOptions?)
Task<ApiResponse> PostAsync(string url, RequestOptions? options = null)
Parameters
urlstringoptionsRequestOptions
Returns
RequestAsync(HttpMethod, string, RequestOptions?)
Task<ApiResponse> RequestAsync(HttpMethod method, string url, RequestOptions? options = null)
Parameters
methodHttpMethodurlstringoptionsRequestOptions
Returns
SendAsync(HttpMethod, string, RequestOptions?)
トランザクション ID やエラー処理を挟まない生のリクエスト(Python 版の _send)。
メディアのダウンロードなど、X の API 以外のホストに使います。
Task<HttpResponseMessage> SendAsync(HttpMethod method, string url, RequestOptions? options = null)
Parameters
methodHttpMethodurlstringoptionsRequestOptions