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?Answer1:
Couple of things to check:<ol><li>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. </li> <li>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:<em>/</em> header and user-agent header etc. Check if the server is behaving differently based on those headers. </li> </ol>Answer2:
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 <a href="http://www.getpostman.com/" rel="nofollow">Postman</a>.
For Firefox, try <a href="https://addons.mozilla.org/en-US/firefox/addon/restclient/" rel="nofollow">RESTClient</a>.