Click or drag to resize

WikiSiteInvokeMediaWikiApiAsyncT(WikiRequestMessage, IWikiResponseMessageParserT, Boolean, CancellationToken) Method

This is preliminary documentation and is subject to change.

Invokes MediaWiki API and gets JSON result.

Namespace: WikiClientLibrary.Sites
Assembly: WikiClientLibrary (in WikiClientLibrary.dll) Version: 0.9.0-int.2+447d1d590e6726b7881f750a0a0e42908f3e417e
Syntax
public Task<T> InvokeMediaWikiApiAsync<T>(
	WikiRequestMessage message,
	IWikiResponseMessageParser<T> responseParser,
	bool suppressAccountAssertion,
	CancellationToken cancellationToken
)

Parameters

message  WikiRequestMessage
The request message.
responseParser  IWikiResponseMessageParserT
The parser that checks and parses the API response into JsonNode.
suppressAccountAssertion  Boolean
Whether to temporarily disable account assertion as set in AccountAssertion.
cancellationToken  CancellationToken
The cancellation token that will be checked prior to completing the returned task.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:WikiClientLibrary.Sites.WikiSite.InvokeMediaWikiApiAsync``1(WikiClientLibrary.Client.WikiRequestMessage,WikiClientLibrary.Client.IWikiResponseMessageParser{``0},System.Boolean,System.Threading.CancellationToken)"]

Return Value

TaskT
A task that returns the JSON response when completed.
Exceptions
ExceptionCondition
InvalidActionExceptionSpecified action is not supported.
OperationFailedExceptionThere is "error" node in returned JSON. Instances of derived types may be thrown.
AccountAssertionFailureExceptionYou enabled account assertion, the assertion failed, and it also failed to retry logging in.
Remarks
Some enhancements are available only if message is MediaWikiFormRequestMessage, including
  • Account assertion, as specified in AccountAssertion.
  • Automatic token-refreshing on badtoken error. This requires you to set all your token fields in the message to a placeholder of type WikiSiteToken, instead of the actual token string.
See Also