本文整理汇总了C#中HttpClient.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# HttpClient.Reset方法的具体用法?C# HttpClient.Reset怎么用?C# HttpClient.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpClient
的用法示例。
在下文中一共展示了HttpClient.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExResult
/// <summary>
/// 发送HTTP请求
/// </summary>
/// <param name="url">请求的URL</param>
/// <param name="param">请求的参数</param>
/// <returns>请求结果</returns>
public string ExResult(BodyParam param = null)
{
param = param == null ? new BodyParam() : param;
HttpClient httpclient = new HttpClient(url);
httpclient.PostingData.Add("apikey", apikey);
httpclient.PostingData.Add("fromdevice", param.fromdevice);
httpclient.PostingData.Add("clientip", param.clientip);
httpclient.PostingData.Add("detecttype", param.detecttype);
httpclient.PostingData.Add("languagetype", param.languagetype);
httpclient.PostingData.Add("imagetype", param.imagetype);
httpclient.PostingData.Add("image", param.image);
httpclient.RequestHeaders.Add("apikey", apikey);
string res = httpclient.GetString();
httpclient.Reset();
return res;
}