【问题标题】:getting exception while geeting json data along with http files在获取 json 数据和 http 文件时出现异常
【发布时间】:2018-05-23 20:32:57
【问题描述】:

我通过邮递员将数据发送到 asp.net webapi。但我得到了例外。需要同时发送文件和 json 数据。

【问题讨论】:

    标签: json asp.net-core-webapi


    【解决方案1】:

    在 C# 编码中也以字符串形式获取 json 格式。

    public JsonResult FileUploadDetails(HttpPostedFileBase[] Files,string request)
           {
    
               //Stream req = Request.InputStream;
               //string reqparm = Request.QueryString["request"];
               //req.Seek(0, System.IO.SeekOrigin.Begin);
               //var jsonStr = new StreamReader(reqparm).ReadToEnd();
               JObject obj = JObject.Parse(request);
                .................
                  ...............
           }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-30
      • 2017-03-31
      • 2021-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-17
      • 2016-07-26
      相关资源
      最近更新 更多