GET request to my API returns Cloud9 homepage


#1

hi there,

A pretty straightforward question.

What is the URL endpoint for cloud9?

I’m doing the “The Ruby on Rails Tutorial” and using that workspace.

I’m assuming that the base URL is at: https://rails-tutorial-my-user-name.c9users.io/

I’m using chrome extension Postman for some testing and to get a better understanding of REST.

When using Postman, I never get the correct result, even for the basic GET request for my application home page etc. The response from querying the base URL using Postman, is always the c9 home page and never my applications’ home page.

Please note that my application pages are loading normally when using Chrome browser.

See the " $ rake routes " listing (attached).

Thanks


Getting no 'access-control-allow-origin' header is present
Spring Boot Application not accessible
#2

That’s the correct baseurl. Postman may be getting the homepage if your workspace is private as I don’t believe postman uses your browser cookies and so it won’t be authenticated. Try making your application url public by clicking on share in the top right of your workspace and ticking the box there. Also make sure you’re using https with postman, not http.

If that still doesn’t work please post your postman output here.


#3

Hi Tim,

Many thanks for your detailed and prompt response.

It solved the issue!

For those of you looking to make your application URL public, the exact path from your workspace is:

Then under “Links to Share” choose the “Public” option for “Application”. This will make the URL public.


#4

I know the issue is solve but there is a proper solution to use postman to request cloud 9 URLs. You have to install interceptor in postman (it’s a plugin) : https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo

After that just enable it.

And send your request!