REST API tutorial: How to Call a JSON API in the Ruby Programming Language
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:
https://www.edutechional.com/2018/08/18/example-of-how-to-work-with-an-api-in-ruby/
Follow me:
Twitter: https://twitter.com/jordanhudgens
Instagram: https://www.instagram.com/jordanhudgens/
GitHub: http://github.com/jordanhudgens
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «REST API tutorial: How to Call a JSON API in the Ruby Programming Language», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.