Export (0) Print
Expand All

MediaTypeFormatterExtensions.AddQueryStringMapping Method (MediaTypeFormatter, String, String, String)

Updates the given set of formatter of MediaTypeMapping elements so that it associates the mediaType with Uris containing a specific query parameter and value.

Namespace:  System.Net.Http.Formatting
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

public static void AddQueryStringMapping(
	this MediaTypeFormatter formatter,
	string queryStringParameterName,
	string queryStringParameterValue,
	string mediaType


Type: System.Net.Http.Formatting.MediaTypeFormatter
The MediaTypeFormatter to receive the new QueryStringMapping item.
Type: System.String
The name of the query parameter.
Type: System.String
The value assigned to that query parameter.
Type: System.String
The media type to associate with a Uri containing a query string matching queryStringParameterName and queryStringParameterValue.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type MediaTypeFormatter. When you use instance method syntax to call this method, omit the first parameter. For more information, see http://msdn.microsoft.com/en-us/library/bb384936(v=vs.108).aspx or http://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).aspx.
© 2014 Microsoft