April 2024
Beginner to intermediate
224 pages
5h 7m
English
Req is quite simple to use for a majority of cases. For example, you would call Req.get!("https://www.google.com") to fetch the Google home page. For more advanced use cases, Req can be customized to include custom headers, authentication, or anything that you need.
For our app, we’ll take advantage of Req.new/1 to create an HTTP client that can be used against our API. Once we have that, we’ll create a context module to use the API in our application. Let’s dive in!
Create a file at lib/phone_app/twilio/api.ex and type the following code:
| 1: | defmodule PhoneApp.Twilio.Api do |
| - | defp twilio_config do |
| - | Application.fetch_env!(:phone_app, :twilio ... |
Read now
Unlock full access