简体   繁体   English

第三方 API Url 在浏览器上工作,但 Te.net 存在问题 - ASP.NET MVC C#

[英]Third Party API Url is working on browser but there is issue at Telnet - ASP.NET MVC C#

I have asp.net mvc application where there is API call of third party application to get the status through HTTPWebRequest Class.我有 asp.net mvc 应用程序,其中有 API 调用第三方应用程序以通过 HTTPWebRequest Class 获取状态。

API Url is opening fine on browser but API Url and IP is not working when we call it through application or making te.net request on 443 port. API Url 在浏览器上打开正常,但 API Url 和 IP 在我们通过应用程序调用它或在 443 端口上发出 te.net 请求时不起作用。

Broswer only can send GET request, so please check your HTTPWebRequest method. Broswer 只能发送GET请求,所以请检查你的HTTPWebRequest方法。

I suggest use HttpHelper , you can refer my somple code in github .我建议使用HttpHelper ,你可以参考我在 github 的简单代码 You just make sure you can access the api in broswer or postman, then my sample code will work fine.你只要确保你可以在浏览器中访问api或postman,那么我的示例代码就可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM