wikimaps-dev / mapwarper

Wikimedia Commons map georectifier and warper. See wikimaps_new branch.
http://warper.wmflabs.org
11 stars 1 forks source link

API calls which are unauthenticated shouldnt redirect to devise views? #105

Closed timwaters closed 8 years ago

timwaters commented 8 years ago

if unauthenticated, http://wikimaps.mapwarper.net/api/v1/users/undefined is redirecting to http://wikimaps.mapwarper.net/u/sign_in and it shouldn't....

timwaters commented 8 years ago

The requests need the correct headers (or format in the url)

$.ajax({
      url: 'http://wikimaps.mapwarper.net/api/v1/users/undefined',
     headers: {          
                "Accept" : "application/json; charset=utf-8",         
                "Content-Type": "application/json; charset=utf-8"   
  },     
      success: function(result) {

      }
 });