How to use external APIs in Rails?

I am trying to use an external API, but did not find any clue in this.

http://open.youku.com/docs/api/videos/show_basic

It looks like I need to build sth from scratch, so how can I start? Is there any example of using an external API that I can access?

I just find them useful: http://railscasts.com/episodes/361-facebook-graph-api

What is the first step to using the REST API in Rails?

+6
source share
2 answers

HTTParty makes it easy to use the JSON API. here's an example: http://blog.teamtreehouse.com/its-time-to-httparty

Please note that the Twitter examples that are around the Internet usually do not work anymore, because Twitter.

+6
source

There is a gem better than named as REST CLIENT. In this u you can easily access the rest-web ex web service ex)

  • get a = RestClient.get 'get Service'
  • post b = RestClient.post 'post service', params
-1
source

Source: https://habr.com/ru/post/946419/


All Articles