Place-kitten API - Getting a response in console, but the course says that I am not getting a response


#1

Hi, I am on the lesson to Make a Request in using APIs with Ruby.
When I enter the below code I get:
"Oops, try again. It looks like you didn’t print anything to the console."
In the console I see an ASCII cat sandwiched by the words
"Unknown Error: " and “RESULT nil”

Can anyone see what I’m doing wrong?
Thank you in advance!

require 'open-uri'

# Open http://placekitten.com/ for reading on line 4!
kittens = open('http://placekitten.com/')
body = kittens.read[559, 441]

# Add your puts statement below!
puts body

From:
https://www.codecademy.com/courses/ruby-beginner-en-pEdhY/1/1?curriculum_id=5122d839c0a131c35f00013d#


#2

Change:

puts body

to

print body

It seems like a typo on the instructions since it says: puts the body variable so we can see the data we got back on line 5 but instead to use print.


#3

Oh, thank you thank you thank you!!! It works!!!


#4

Thanks for saving me here!


23andMe API Lesson 10. HTTP Status Codes placekitten.status
#5

@kingdarboja, isn’t this an error in the lesson itself? Either the description or answer checker needs changing…