| RequestUtilityHttpPostAsync 方法 (IServiceProvider, String, CookieContainer, Stream, DictionaryString, String, String, Encoding, X509Certificate2, Boolean, DictionaryString, String, Int32, Boolean, String) |
Senparc.Weixin SDK 官方教程《微信开发深度解析》已出版,支持中国开源事业,请【购买正版】!
《微信公众号+小程序》视频课程已经上线,【点击这里】学习!
NeuChar(纽插)已经上线,为开发者提供一站式跨平台管理枢纽,并可将应用入驻到 NeuChar 应用商店!新功能正在不断增加中,快来使用吧! https://www.neuchar.com
在线动态微信接口 Swagger WebApi 文档: https://weixin.senparc.com:8039
使用Post方法获取字符串结果
命名空间:
Senparc.CO2NET.HttpUtility
程序集:
Senparc.CO2NET (在 Senparc.CO2NET.dll 中) 版本:1.4.300-preview.3.21201.4.100+9de96adf02982fcbddc436d3680e19a719e9d8b2
语法 public static Task<string> HttpPostAsync(
IServiceProvider serviceProvider,
string url,
CookieContainer cookieContainer = null,
Stream postStream = null,
Dictionary<string, string> fileDictionary = null,
string refererUrl = null,
Encoding encoding = null,
X509Certificate2 cer = null,
bool useAjax = false,
Dictionary<string, string> headerAddition = null,
int timeOut = 10000,
bool checkValidationResult = false,
string contentType = "text/xml"
)
Public Shared Function HttpPostAsync (
serviceProvider As IServiceProvider,
url As String,
Optional cookieContainer As CookieContainer = Nothing,
Optional postStream As Stream = Nothing,
Optional fileDictionary As Dictionary(Of String, String) = Nothing,
Optional refererUrl As String = Nothing,
Optional encoding As Encoding = Nothing,
Optional cer As X509Certificate2 = Nothing,
Optional useAjax As Boolean = false,
Optional headerAddition As Dictionary(Of String, String) = Nothing,
Optional timeOut As Integer = 10000,
Optional checkValidationResult As Boolean = false,
Optional contentType As String = "text/xml"
) As Task(Of String)
参数
- serviceProvider
- 类型:SystemIServiceProvider
.NetCore 下的服务器提供程序,如果 .NET Framework 则保留 null - url
- 类型:SystemString
- cookieContainer (Optional)
- 类型:System.NetCookieContainer
- postStream (Optional)
- 类型:System.IOStream
- fileDictionary (Optional)
- 类型:System.Collections.GenericDictionaryString, String
需要上传的文件,Key:对应要上传的Name,Value:本地文件名,或文件内容的Base64编码 - refererUrl (Optional)
- 类型:SystemString
- encoding (Optional)
- 类型:System.TextEncoding
- cer (Optional)
- 类型:System.Security.Cryptography.X509CertificatesX509Certificate2
- useAjax (Optional)
- 类型:SystemBoolean
- headerAddition (Optional)
- 类型:System.Collections.GenericDictionaryString, String
header附加信息 - timeOut (Optional)
- 类型:SystemInt32
- checkValidationResult (Optional)
- 类型:SystemBoolean
验证服务器证书回调自动验证 - contentType (Optional)
- 类型:SystemString
返回值
类型:
TaskString参见