Playback starts YouTube’s embedded player (privacy-enhanced mode).
REST API tutorial: How to Call a JSON API in the Ruby Programming Language
ChanneledutechionalDescription from the creator
This is an exciting section as we are going to learn how to work with API calls in this Ruby programming tutorial. We'll start out with a basic API example and get into more advanced ways to work with APIs in subsequent guides.
This is an exciting section as we are going to learn how to work with API calls in Ruby. We'll start out with a basic API example and get into more advanced ways to work with APIs in subsequent guides.
Here, I have an API called Resty that I built for this course. Resty is a short for RESTful interfaces for Routing, and it's a basic API that has posts and makes them available to the API through the json data type.
There are many requirements for interacting with APIs in Ruby, and in this guide we are going to leverage the httparty RubyGem to handle API communication. If you don't have this gem on your local system, you can install it with the command gem install httparty.
In this code, we are creating a class called EdutechionalResty. We start by including the httparty call, and then use a variable that this gem provides called base_uri. As the name suggests, this is the base URI we are going to be using for this application.
Next, we create a method called posts and call an instance of this method. It takes a parameter, which is the endpoint of our API's URL. So, this is all we have to do inside this class.
View code and written guide:
edutechional.com/2018/08/18/example-of-how-to-w…
Follow me:
Twitter: twitter.com/jordanhudgens
Instagram: instagram.com/jordanhudgens/
GitHub: github.com/jordanhudgens
This is an exciting section as we are going to learn how to work with API calls in Ruby. We'll start out with a basic API example and get into more advanced ways to work with APIs in subsequent guides.
Here, I have an API called Resty that I built for this course. Resty is a short for RESTful interfaces for Routing, and it's a basic API that has posts and makes them available to the API through the json data type.
There are many requirements for interacting with APIs in Ruby, and in this guide we are going to leverage the httparty RubyGem to handle API communication. If you don't have this gem on your local system, you can install it with the command gem install httparty.
In this code, we are creating a class called EdutechionalResty. We start by including the httparty call, and then use a variable that this gem provides called base_uri. As the name suggests, this is the base URI we are going to be using for this application.
Next, we create a method called posts and call an instance of this method. It takes a parameter, which is the endpoint of our API's URL. So, this is all we have to do inside this class.
View code and written guide:
edutechional.com/2018/08/18/example-of-how-to-w…
Follow me:
Twitter: twitter.com/jordanhudgens
Instagram: instagram.com/jordanhudgens/
GitHub: github.com/jordanhudgens
About this tutorial
edutechional published this 5:42 video tutorial on October 29, 2016. It has been watched 34,639 times on YouTube.
- Channel
- edutechional
- Category
- Science & Technology
- Duration
- 5:42
- Published
- October 29, 2016
- Views
- 34,639
- Likes
- 286
Tags
Share
This tutorial in other languages
- FRREST API tutoriel: Comment appeler une API JSON dans la programmation Ruby Langue
- ESREST API tutorial: Cómo llamar a una API JSON en la programación Lenguaje Ruby
- PTRESTO tutorial API: Como chamar a API JSON no Programming Ruby Idioma
- ITAPI REST tutorial: Come chiamare un API JSON nella programmazione Ruby Lingua
- DEREST API-Tutorial: Wie ein JSON-API in der Programmiersprache Ruby Call
- NLREST API Tutorial: Hoe maak je een JSON API in de programmeertaal Ruby Bel
- RUREST API учебник: Как вызвать API JSON в Programming Ruby, язык
- PLREST API poradnik: Jak Call API JSON w programowaniu Ruby Języka
- JAREST APIのチュートリアル:Rubyプログラミング言語でJSON APIを呼び出す方法
- ARREST API البرنامج التعليمي: كيفية استدعاء API JSON في البرمجة روبي اللغة
- HIREST API ट्यूटोरियल: रूबी प्रोग्रामिंग भाषा में एक JSON एपीआई कॉल करने के लिए कैसे
- IDSISA API tutorial: Bagaimana Panggil API JSON di Pemrograman Ruby Bahasa