Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are really trying to create a restful API instead if some URL endpoints which happen to speak some HTTP dialect, you should stick to GET. It's even again in your path, so you seem to be pretty sure it's a get.</p> <p>Instead of trying to hide the username and password in <code>GET</code> or <code>POST</code> parameters, you should instead use <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" rel="nofollow">Basic authentication</a>, which was invented especially for that purpose and is universally available in clients (and is available using convenience methods in Sinatra).</p> <p>Also, if you are trying to use REST, you should embrace the concept of resources and resoiurce collections (which is implied by the R and E of REST). So you have a single URL like <code>http://myapi.heroku.com/NearbyPlaces</code>. If you <code>GET</code> there, you gather information about that resource, if you <code>POST</code>, you create a new resource, if you <code>PUT</code> yopu update n existing resource and if you <code>DELETE</code>, well, you delete it. What you should do before is th structure your object space into these resources and design your API around it.</p> <p>Possibly, you could have a resource collection at <code>http://myapi.heroku.com/places</code>. Each place as a resource has a unique URL like <code>http://myapi.heroku.com/places/123</code>. New polaces can be created by <code>POST</code>ing to <a href="http://myapi.heroku.com/places" rel="nofollow">http://myapi.heroku.com/places</a>. And nearby places could be gathered by <code>GET</code>ing <code>http://myapi.heroku.com/places/nearby?lon=12.343523&amp;lat=56.123533&amp;radius=30</code>. hat call could return an Array or URLs to nearby places, e.g.</p> <pre><code>[ "http://myapi.heroku.com/places/123", "http://myapi.heroku.com/places/17", "http://myapi.heroku.com/places/42" ] </code></pre> <p>If you want to be truly discoverable, you might also embrace <a href="http://en.wikipedia.org/wiki/HATEOAS" rel="nofollow">HATEOAS</a> which constraints REST smentics in a way to allows API clients to "browse" through the API as a user with a browser would do. To allow this, you use Hyperlink inside your API which point to other resources, kind of like in the example above.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload