zoukankan      html  css  js  c++  java
  • 发起post请求

      

    string postUrl = "https://api.mch.weixin.qq.com/mmpaymkttransfers/gethbinfo";
    //string requestStr= Utils.DCUtils.HttpPost(postUrl,HttpUtility.UrlEncode(requestXml));
    //string requestStr = Utils.DCUtils.HttpPost(postUrl,"xml="+requestXml);

    #region 发起post请求
    HttpWebRequest webrequest = (HttpWebRequest)HttpWebRequest.Create(postUrl);
    //webrequest.ClientCertificates.Add(cer);
    webrequest.Method = "post";

    byte[] postdatabyte = Encoding.UTF8.GetBytes(requestXml);
    webrequest.ContentLength = postdatabyte.Length;
    Stream stream;
    stream = webrequest.GetRequestStream();
    stream.Write(postdatabyte, 0, postdatabyte.Length);
    stream.Close();

    HttpWebResponse httpWebResponse = (HttpWebResponse)webrequest.GetResponse();
    StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream());
    string requestStr = streamReader.ReadToEnd();
    #endregion

  • 相关阅读:
    数据查询
    泰勒展开及其应用
    搜索排序算法
    因子分解机 FM
    偏差方差分解
    Softmax 损失-梯度计算
    目标检测网络之 Mask R-CNN
    目标检测网络之 R-FCN
    深度学习-conv卷积
    目标检测网络之 YOLOv3
  • 原文地址:https://www.cnblogs.com/james641/p/4980517.html
Copyright © 2011-2022 走看看