如何在Mvc 4中从另一个项目或不同解决方案访问Web Api? [英] How Can I Access Web Api From Another Project Or Different Solution In Mvc 4?
本文介绍了如何在Mvc 4中从另一个项目或不同解决方案访问Web Api?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将该网络API分享到多个平台,如下方法?
How to share that web API to multiple platforms like below method?
$.ajax({
type: "POST",
//url: "http://localhost:63461/api/CarDetails/",
)}
)}
推荐答案
.ajax({
类型:POST,
// url: http:// localhost:63461 / api / CarDetails /,
.ajax({ type: "POST", //url: "http://localhost:63461/api/CarDetails/",
)}
)}
2种方式 -
1.当你试图从另一个项目访问它时,WebAPI程序应该正在运行。
2.或者最好的方法是在IIS上托管WebAPI。
-KR
2 ways-
1. WebAPI program should be running while you're trying to access it from another project.
2. Or the best way is, host the WebAPI on IIS.
-KR
这篇关于如何在Mvc 4中从另一个项目或不同解决方案访问Web Api?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文