| WikiSiteInvokeMediaWikiApiAsyncT(WikiRequestMessage, IWikiResponseMessageParserT, Boolean, CancellationToken) Method |
This is preliminary documentation and is subject to change.
Invokes MediaWiki API and gets JSON result.
Namespace: WikiClientLibrary.SitesAssembly: 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
)
Public Function InvokeMediaWikiApiAsync(Of T) (
message As WikiRequestMessage,
responseParser As IWikiResponseMessageParser(Of T),
suppressAccountAssertion As Boolean,
cancellationToken As CancellationToken
) As Task(Of T)
Dim instance As WikiSite
Dim message As WikiRequestMessage
Dim responseParser As IWikiResponseMessageParser(Of T)
Dim suppressAccountAssertion As Boolean
Dim cancellationToken As CancellationToken
Dim returnValue As Task(Of T)
returnValue = instance.InvokeMediaWikiApiAsync(message,
responseParser, suppressAccountAssertion,
cancellationToken)
public:
generic<typename T>
Task<T>^ InvokeMediaWikiApiAsync(
WikiRequestMessage^ message,
IWikiResponseMessageParser<T>^ responseParser,
bool suppressAccountAssertion,
CancellationToken cancellationToken
)
member InvokeMediaWikiApiAsync :
message : WikiRequestMessage *
responseParser : IWikiResponseMessageParser<'T> *
suppressAccountAssertion : bool *
cancellationToken : CancellationToken -> Task<'T>
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
TaskTA task that returns the JSON response when completed.
Exceptions 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