| PostPostGetJsonT 方法 (IServiceProvider, String, CookieContainer, Stream, Encoding, X509Certificate2, Boolean, Boolean, ActionString, String, Int32) |
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 T PostGetJson<T>(
IServiceProvider serviceProvider,
string url,
CookieContainer cookieContainer = null,
Stream fileStream = null,
Encoding encoding = null,
X509Certificate2 cer = null,
bool useAjax = false,
bool checkValidationResult = false,
Action<string, string> afterReturnText = null,
int timeOut = 10000
)
Public Shared Function PostGetJson(Of T) (
serviceProvider As IServiceProvider,
url As String,
Optional cookieContainer As CookieContainer = Nothing,
Optional fileStream As Stream = Nothing,
Optional encoding As Encoding = Nothing,
Optional cer As X509Certificate2 = Nothing,
Optional useAjax As Boolean = false,
Optional checkValidationResult As Boolean = false,
Optional afterReturnText As Action(Of String, String) = Nothing,
Optional timeOut As Integer = 10000
) As T
参数
- serviceProvider
- 类型:SystemIServiceProvider
.NetCore 下的服务器提供程序,如果 .NET Framework 则保留 null - url
- 类型:SystemString
请求Url - cookieContainer (Optional)
- 类型:System.NetCookieContainer
CookieContainer,如果不需要则设为null - fileStream (Optional)
- 类型:System.IOStream
文件流 - encoding (Optional)
- 类型:System.TextEncoding
- cer (Optional)
- 类型:System.Security.Cryptography.X509CertificatesX509Certificate2
证书,如果不需要则保留null - useAjax (Optional)
- 类型:SystemBoolean
是否使用Ajax请求 - checkValidationResult (Optional)
- 类型:SystemBoolean
验证服务器证书回调自动验证 - afterReturnText (Optional)
- 类型:SystemActionString, String
返回JSON本文,并在进行序列化之前触发,参数分别为:url、returnText - timeOut (Optional)
- 类型:SystemInt32
代理请求超时时间(毫秒)
类型参数
- T
- 返回数据类型(Json对应的实体)
返回值
类型:
T参见