MediaTypeFormatterExtensions.AddUriPathExtensionMapping Method (MediaTypeFormatter, String, )
Updates the given formatter's set of MediaTypeMapping elements so that it associates the mediaType with Uris ending with the given uriPathExtension.
Namespace: System.Net.Http.Formatting
Assembly: System.Web.Http (in System.Web.Http.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Sub AddUriPathExtensionMapping ( _
formatter As MediaTypeFormatter, _
uriPathExtension As String, _
mediaType As MediaTypeHeaderValue _
)
'Usage
Dim formatter As MediaTypeFormatter
Dim uriPathExtension As String
Dim mediaType As MediaTypeHeaderValue
formatter.AddUriPathExtensionMapping(uriPathExtension, _
mediaType)
public static void AddUriPathExtensionMapping(
this MediaTypeFormatter formatter,
string uriPathExtension,
MediaTypeHeaderValue mediaType
)
[ExtensionAttribute]
public:
static void AddUriPathExtensionMapping(
MediaTypeFormatter^ formatter,
String^ uriPathExtension,
MediaTypeHeaderValue^ mediaType
)
static member AddUriPathExtensionMapping :
formatter:MediaTypeFormatter *
uriPathExtension:string *
mediaType:MediaTypeHeaderValue -> unit
public static function AddUriPathExtensionMapping(
formatter : MediaTypeFormatter,
uriPathExtension : String,
mediaType : MediaTypeHeaderValue
)
Parameters
- formatter
Type: System.Net.Http.Formatting.MediaTypeFormatter
The MediaTypeFormatter to receive the new UriPathExtensionMapping item.
- uriPathExtension
Type: System.String
The string of the Uri path extension.
- mediaType
Type: MediaTypeHeaderValue
The MediaTypeHeaderValue to associate with Uris ending with uriPathExtension.
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 https://msdn.microsoft.com/en-us/library/bb384936(v=vs.108) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).
See Also
Reference
MediaTypeFormatterExtensions Class