How can retrieve string formData js in c#

后端 未结 3 501
南笙
南笙 2021-01-02 17:58

I have to retrieve the value of \"idPerson\" in my web api in .net. I already retrieve the file \"UploadedImage\". But I can\'t retrieve the value of \"idPerson\".

S

3条回答
  •  耶瑟儿~
    2021-01-02 18:52

    Assuming your are sending typical Ajax POST request, you can retrieve each field from HttpContext.Current.Request.Form collection.

    Just find your key in collection like HttpContext.Current.Request.Form["KEY"]

    TBH it is hard to say how to retrieve any value when you did not provide the way of sending data.

提交回复
热议问题