How to get POST data in WebAPI?

前端 未结 8 1336
天涯浪人
天涯浪人 2020-11-29 21:32

I\'m sending a request to server in the following form:

http://localhost:12345/api/controller/par1/par2

The request is correctly resolved t

8条回答
  •  庸人自扰
    2020-11-29 21:54

    Try this.

    public string Post(FormDataCollection form) {
        string par1 = form.Get("par1");
    
        // ...
    }
    

    It works for me with webapi 2

提交回复
热议问题