This forum is now read-only. Please use our new forums at discuss.codecademy.com.

OAuth2 Forum

View Course

574 points
51470b3e323c45f7a10054f6_863618376
Submitted by
Mark Milligan
over 4 years ago

scope exercise isn't being accepted

Getting error "did you remember to pass oauth header" when running this code. Seems to follow the hint:

require 'httparty'
require 'json'

token = "e6a75d6b6d7b0fdd0eee93fd3c141d808852a0e9"
request_headers = {"Authorization" => "token: #{token}"}

response = HTTParty.get "https://api.github.com",
:headers => request_headers

print response.headers["X-OAuth-Scopes"]


1 vote

permalink

Hey,

put some parantheses around "X-OAuth-Scopes" instead of square brackets.
There is still some error code but it passes.

2590 points
Picture
Submitted by
Franzi Vegas
over 4 years ago

2 Comments

7646689fc55e3c241b0065af44e43b50?s=140&d=retro WhoTheWhatThe over 4 years ago

This fix passes but doesn't get the correct response. Any advance from anyone?

510e9974831c965fe1007cb1_737802895 David Fife over 4 years ago

I am kind of having trouble as it's my first time with this stuff, but without the print resonse.headers line, it passed and gave me some output, but with that line I got nil back and it also passed