如何从ASP.Net Web服务中的POST方法获取参数值? [英] How to get parameter value from POST method in ASP.Net Web Service?

查看:88
本文介绍了如何从ASP.Net Web服务中的POST方法获取参数值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个Web服务来使用POST方法处理来自Android应用程序的请求.这是我的控制器:

I am creating a Web Service to handle request from Android application using POST method. Here is my controller:

[AcceptVerbs(HttpVerbs.Post)]
public JsonResult Verify(String formCollection) {
...
}


通过使用此方法,我没有在formCollection中获得任何参数.请帮帮我!


By using this method, I didn''t get any parameters in formCollection. Please help me!

Thanks!

推荐答案

将参数类型更改为FormCollection而不是字符串.请参阅此以获得更多帮助
http://stack247.wordpress .com/2011/03/20/get-forms-post-values-in-asp-net-mvc-with-formcollection/ [ http://www.beletsky.net/2011/01/implementation-of- rest-service-with.html [ ^ ]
Change type of parameter to FormCollection instead of string. Refer this for more help
http://stack247.wordpress.com/2011/03/20/get-forms-post-values-in-asp-net-mvc-with-formcollection/[^]
Refer this too
http://www.beletsky.net/2011/01/implementation-of-rest-service-with.html[^]


这篇关于如何从ASP.Net Web服务中的POST方法获取参数值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆