Android:无法发布数据

时间:2013-07-26 08:19:02

标签: android asp.net-mvc-4

我正在使用asp.net mvc web api并从android发布数据但无法发布数据

由于某些原因,我在这里添加了虚拟网址。

API代码:这是我发送数据的方法。

public ActionResult Match(IEnumerable<HttpPostedFileBase> MatchImage)
{

//代码在这里     }

Android帖子代码

HttpClient client = new DefaultHttpClient();    
            String postURL = "http://dummyurl.com/api/Match/VerifyImage";
            HttpPost post = new HttpPost(postURL);

                List<NameValuePair> params = new ArrayList<NameValuePair>();

                 params.add(new BasicNameValuePair("MatchImage",imageData));

                 UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8);
                 post.setEntity(ent);
                HttpResponse responsePOST = client.execute(post);  
                HttpEntity resEntity = responsePOST.getEntity();  
                if (resEntity != null) {     

                System.out.println("-------------------->>>"+EntityUtils.toString(resEntity));


                }

回复:

{“Message”:“找不到与请求URI'http://dummyurl.com/api/Match/VerifyImage'匹配的HTTP资源。”,“MessageDetail”:“找不到与名为'Match'的控制器匹配的类型。”} < / p>

请帮帮我..谢谢

0 个答案:

没有答案