Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting exception while geeting json data along with http files

Api Exception

i am sending the data through postman to asp.net webapi. But i am getting the exception.Need to send both file and json data.

Data passing through post man.

like image 265
Kavitha Prabhu Avatar asked Mar 09 '26 02:03

Kavitha Prabhu


1 Answers

Get the json format also in C# coding as string.

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);
            .................
              ...............
       }
like image 105
Revathi Vijay Avatar answered Mar 11 '26 00:03

Revathi Vijay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!