How do I post data to MVC Controller using HttpWebRequest?

后端 未结 3 1207
离开以前
离开以前 2021-01-05 16:03

I am trying to post data to MVC controller action but have been unsuccessful so far.

Here is the structure of the post data:

private string makeHttp         


        
3条回答
  •  星月不相逢
    2021-01-05 16:39

    I'm wrestling the same beast over here: Trying to set up a controller action as Xml endpoint

    You may be getting the internal server error because either you have page validation on (solution: addotate with ValidateInput(false)), or you're not sending an Accept-Encoding header with your request. I would very much like to hear how I can get MVC to accept posted input without the Accept-Encoding HTTP header...

提交回复
热议问题