Click or drag to resize

MediaWikiFormRequestMessage Class

This is preliminary documentation and is subject to change.

The MediaWiki API request message consisting of parameter key-value pairs (fields).
Inheritance Hierarchy
SystemObject
  WikiClientLibrary.ClientWikiRequestMessage
    WikiClientLibrary.ClientMediaWikiFormRequestMessage

Namespace: WikiClientLibrary.Client
Assembly: WikiClientLibrary (in WikiClientLibrary.dll) Version: 0.9.0-int.2+447d1d590e6726b7881f750a0a0e42908f3e417e
Syntax
public class MediaWikiFormRequestMessage : WikiRequestMessage

The MediaWikiFormRequestMessage type exposes the following members.

Constructors
 NameDescription
Public methodMediaWikiFormRequestMessage(Object)Initializes a new instance of the MediaWikiFormRequestMessage class
Public methodMediaWikiFormRequestMessage(Object, Boolean)Initializes a new instance of the MediaWikiFormRequestMessage class
Public methodMediaWikiFormRequestMessage(String, Object, Boolean)Initializes a new instance of the MediaWikiFormRequestMessage class
Top
Properties
 NameDescription
Public propertyAsMultipartFormData Determines whether this message should be marshaled in multipart/form-data MIME type.
Public propertyFields Gets a read-only list of all the fields in the form.
Public propertyId Id of the request, for tracing.
(Inherited from WikiRequestMessage)
Top
Methods
 NameDescription
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetHttpContent Gets the HttpContent corresponding to this message.
(Overrides WikiRequestMessageGetHttpContent)
Public methodGetHttpMethod Gets the HTTP method used to send the request.
(Overrides WikiRequestMessageGetHttpMethod)
Public methodGetHttpQuery Gets the URI query part for the endpoint invocation.
(Overrides WikiRequestMessageGetHttpQuery)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from WikiRequestMessage)
Top
Remarks

This is the primary message type used in the WikiClientLibrary. This type provides some useful functionalities such as constructing fields from anonymous objects, and simple type (e.g. DateTime) marshalling. while overriding the rest.

This message can be later converted into application/x-www-form-urlencoded or multipart/form-data http content.

When converting the form into HttpContent, the values are marshaled in the following way

  • null values are ignored.
  • string values are kept intact.
  • bool values are marshaled as ""(Empty) for true, and are ignored for false.
  • DateTime values are marshaled as UTC in ISO 8601 format.
  • Stream values are sent as StreamContent with a dummy file name, and this will force the whole form to be marshaled as MultipartFormDataContent.
  • JsonContent values are sent as JSON string content. (Not implemented yet)
  • AutoWatchBehavior values are marshaled as one of "preferences", "nochange", "watch", "unwatch".
  • Other types of values are marshaled by calling ToString on them.
Note that the message sending methods (e.g. InvokeMediaWikiApiAsync(WikiRequestMessage, CancellationToken)) may also change the way the message is marshaled. For the detailed information, please see the message sender's documentations respectively.

This message uses POST method to invoke API requests.

See Also