zoukankan      html  css  js  c++  java
  • C#进行Post请求(解决url过长的问题)

    //实例代码:

    1.post请求

    private string GetImageXY(string imgbyte)
    {
    string result3 = string.Empty;
    try
    {
    string requestUri = "";//请求的url
    HttpClient httpClient = new HttpClient();
    //参数实例 p1=v1&p2=v2
    string str = "imgbase64=" + imgbyte;
    var content = new StringContent(str, Encoding.UTF8, "application/x-www-form-urlencoded");
    HttpResponseMessage result = httpClient.PostAsync(requestUri, content).Result;
    string result2 = result.Content.ReadAsStringAsync().Result;
    result3 = result2;
    }
    catch (Exception ex)
    {
    result3 = "error";
    }
    return result3;
    }

    2.Get请求

    //有时间再来补充

  • 相关阅读:
    填充与复制
    张量排序
    数据统计
    合并与分割
    前向传播(张量)- 实战
    数学运算
    Broadcasting
    TensorFlow2-维度变换
    集合3
    集合2
  • 原文地址:https://www.cnblogs.com/xiewei123/p/10902501.html
Copyright © 2011-2022 走看看