次の方法で共有


HttpRequestMessageExtensions.GetQueryNameValuePairs Method

Gets the parsed query string as a collection of key-value pairs.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function GetQueryNameValuePairs ( _
    request As HttpRequestMessage _
) As IEnumerable(Of KeyValuePair(Of String, String))
'Usage
Dim request As HttpRequestMessage 
Dim returnValue As IEnumerable(Of KeyValuePair(Of String, String))

returnValue = request.GetQueryNameValuePairs()
public static IEnumerable<KeyValuePair<string, string>> GetQueryNameValuePairs(
    this HttpRequestMessage request
)
[ExtensionAttribute]
public:
static IEnumerable<KeyValuePair<String^, String^>>^ GetQueryNameValuePairs(
    HttpRequestMessage^ request
)
static member GetQueryNameValuePairs : 
        request:HttpRequestMessage -> IEnumerable<KeyValuePair<string, string>> 
public static function GetQueryNameValuePairs(
    request : HttpRequestMessage
) : IEnumerable<KeyValuePair<String, String>>

Parameters

  • request
    Type: HttpRequestMessage

    The HTTP request.

Return Value

Type: System.Collections.Generic.IEnumerable<KeyValuePair<String, String>>
The query string as a collection of key-value pairs.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpRequestMessage. 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

HttpRequestMessageExtensions Class

System.Net.Http Namespace