HttpExtensionsSetFormUrlEncodedContentTRequest 方法
将一个键值对集合按照application/x-www-form-urlencoded格式设置到HttpRequest的内容中
命名空间: TouchSocket.Http程序集: TouchSocket.Http (在 TouchSocket.Http.dll 中) 版本:4.0.0-beta.143+5fcca7a4e70968794985dc3793adc50531308be6
public static void SetFormUrlEncodedContent<TRequest>(
this TRequest request,
IEnumerable<KeyValuePair<string, string>> nameValueCollection
)
where TRequest : HttpRequest
<ExtensionAttribute>
Public Shared Sub SetFormUrlEncodedContent(Of TRequest As HttpRequest) (
request As TRequest,
nameValueCollection As IEnumerable(Of KeyValuePair(Of String, String))
)
[<ExtensionAttribute>]
static member SetFormUrlEncodedContent :
request : 'TRequest *
nameValueCollection : IEnumerable<KeyValuePair<string, string>> -> unit when 'TRequest : HttpRequest
- request TRequest
- 待设置内容的HttpRequest对象
- nameValueCollection IEnumerableKeyValuePairString, String
- 包含键值对的集合,将被转换为查询字符串格式
- TRequest
- HttpRequest的类型,使用泛型以支持所有HttpRequest的子类
在 Visual Basic 和 C# 中,这个方法可以当成为类型
TRequest 的实例方法来调用。在采用实例方法语法调用这个方法时,请省略第一个参数。请参考
扩展方法 (Visual Basic) 或
扩展方法 (C# 编程指南) 获取更多信息。