| MediaWikiJsonResponseParserParseResponseAsync Method |
This is preliminary documentation and is subject to change.
Parses the specified HTTP response message.
Namespace: WikiClientLibrary.ClientAssembly: WikiClientLibrary (in WikiClientLibrary.dll) Version: 0.9.0-int.2+447d1d590e6726b7881f750a0a0e42908f3e417e
Syntax public override Task<JsonNode> ParseResponseAsync(
HttpResponseMessage response,
WikiResponseParsingContext context
)
Public Overrides Function ParseResponseAsync (
response As HttpResponseMessage,
context As WikiResponseParsingContext
) As Task(Of JsonNode)
Dim instance As MediaWikiJsonResponseParser
Dim response As HttpResponseMessage
Dim context As WikiResponseParsingContext
Dim returnValue As Task(Of JsonNode)
returnValue = instance.ParseResponseAsync(response,
context)
public:
virtual Task<JsonNode^>^ ParseResponseAsync(
HttpResponseMessage^ response,
WikiResponseParsingContext^ context
) override
abstract ParseResponseAsync :
response : HttpResponseMessage *
context : WikiResponseParsingContext -> Task<JsonNode>
override ParseResponseAsync :
response : HttpResponseMessage *
context : WikiResponseParsingContext -> Task<JsonNode>
Parameters
- response HttpResponseMessage
- The HTTP response message to parse.
- context WikiResponseParsingContext
- The parsing context.
Return Value
TaskJsonNodeA strongly-typed object containing the desired response.
Remarks This method checks the HTTP status code first.
For non-successful HTTP status codes, this method will request for a retry.
Then the content will be parsed as JSON, in JsonNode. If there is
JsonException thrown while parsing the response, a retry will be requested.
Finally, before returning the parsed JSON, this method checks for warning and error
nodes. If there exists warning node, a warning will be issued to the logger. If there exists error
node, a OperationFailedException or its derived exception will be thrown. You can
customize the error generation behavior by overriding OnApiError(String, String, JsonNode, JsonNode, WikiResponseParsingContext) method.
See Also