Click or drag to resize

MediaWikiJsonResponseParserParseResponseAsync Method

This is preliminary documentation and is subject to change.

Parses the specified HTTP response message.

Namespace: WikiClientLibrary.Client
Assembly: WikiClientLibrary (in WikiClientLibrary.dll) Version: 0.9.0-int.2+447d1d590e6726b7881f750a0a0e42908f3e417e
Syntax
public override Task<JsonNode> ParseResponseAsync(
	HttpResponseMessage response,
	WikiResponseParsingContext context
)

Parameters

response  HttpResponseMessage
The HTTP response message to parse.
context  WikiResponseParsingContext
The parsing context.

Return Value

TaskJsonNode
A 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