ROR + Google Book API - Unable to store book data using ISBN number

218 views Asked by At

In my sample project, I am trying to access Google Book API using URL but I am not able to store book details in database using isbn number.

url = URI.parse('https://www.googleapis.com/books/v1/volumes?isbn=xxxxxxxxxx')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
  http.request(req)
}
puts res.

I am not able to figure out that where I am lacking, may be approach is wrong.

In my controller I tried above sample code to access the values but no success. Is there any other way to handle this.

Error occured while using googlebook gem enter image description here

0

There are 0 answers