StephenGrider / ReactCasts

App by app code for Build Web Apps with React JS
585 stars 244 forks source link

(bug) imgur app - imgur API errors #9

Closed Shinobi881 closed 8 years ago

Shinobi881 commented 8 years ago

screen shot 2015-12-04 at 3 17 25 pm screen shot 2015-12-04 at 3 18 46 pm

Shinobi881 commented 8 years ago

Never mind on this. It was something with my code and the 'Malformed auth header'. Thanks again!

Also, how important is it at this point to Redux over Reflux? Looking forward to that tutorial.

Shinobi881 commented 8 years ago

Found it! It was the space in the Client-ID string missing.

I realized it was me and not Imgur, when I was able to get it to work by initialized through Postman, and then using the app.

module.exports = {
  get: function(url) {
    return fetch(rootUrl + url, {
      headers: {
        'Authorization': 'Client-ID' + apiKey
      }
    })
    .then(function(response){
      return response.json()
    })
  }
};