Apigee API end point gives 503 on the browser, but a 200 on Apigee trace and curl

亡梦爱人 提交于 2019-12-25 12:20:29

问题


We use Apigee proxy to invoke our API. All works well when we test it out within Apigee trace. Also works fine with curl. But on a browser, it gives a 503. This is not consistent though, sometimes it gives a 200 on the browser too. Tried Chrome and Firefox, same behavior.

Our API still executes well though. We do not return any response, merely set the status. Any ideas on what we could try out to get a 200 on the browser?


回答1:


Couple of things to check:

  1. Check if your Browser has a DNS entry caching. Sometimes services like ELB changes the actual IPs. So caching DNS entries may result in 503.
  2. Another you may want to check is the difference is in the HTTP Verb used. Browsers send a GET request. But curl commands can do all. So if your service is specifically not serving GET calls you may get some server side errors. Also curl sends certain headers even if you do not explicitly send. E.g., Accept:/ header and user-agent header etc. Check if the server is behaving differently based on those headers.



回答2:


You should look into using Chrome or Firefox extensions for this. There are two in particular which support a wide range of additional features for API developers.

For Chrome, try Postman.

For Firefox, try RESTClient.

Thanks.



来源:https://stackoverflow.com/questions/22386148/apigee-api-end-point-gives-503-on-the-browser-but-a-200-on-apigee-trace-and-cur

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!