Table of Contents

Interface IRequestClient

Namespace
Twikit.Api
Assembly
Twikit.dll

GraphQL / v1.1 の各エンドポイント層が必要とする、最小限のリクエスト機能。 Client と GuestClient の両方が実装します。

public interface IRequestClient

Properties

BaseHeaders

API リクエストの基本ヘッダー(呼び出しごとに新しい辞書)。

Dictionary<string, string> BaseHeaders { get; }

Property Value

Dictionary<string, string>

Methods

GetAsync(string, RequestOptions?)

Task<ApiResponse> GetAsync(string url, RequestOptions? options = null)

Parameters

url string
options RequestOptions

Returns

Task<ApiResponse>

GetCsrfToken()

Cookie 中の CSRF トークン(ct0)。無ければ null。

string? GetCsrfToken()

Returns

string

PostAsync(string, RequestOptions?)

Task<ApiResponse> PostAsync(string url, RequestOptions? options = null)

Parameters

url string
options RequestOptions

Returns

Task<ApiResponse>

RequestAsync(HttpMethod, string, RequestOptions?)

Task<ApiResponse> RequestAsync(HttpMethod method, string url, RequestOptions? options = null)

Parameters

method HttpMethod
url string
options RequestOptions

Returns

Task<ApiResponse>

SendAsync(HttpMethod, string, RequestOptions?)

トランザクション ID やエラー処理を挟まない生のリクエスト(Python 版の _send)。 メディアのダウンロードなど、X の API 以外のホストに使います。

Task<HttpResponseMessage> SendAsync(HttpMethod method, string url, RequestOptions? options = null)

Parameters

method HttpMethod
url string
options RequestOptions

Returns

Task<HttpResponseMessage>