May 2018
Intermediate to advanced
412 pages
9h 3m
English
Add the dependency to your project and install it.
So, back to our problem. We have to write the function GithubIssues.fetch, which transforms a user name and project into a data structure containing that project’s issues. The HTTPoison page on GitHub gives us a clue,[22] and we write a new module, Issues.GithubIssues:
| | defmodule Issues.GithubIssues do |
| | @user_agent [ {"User-agent", "Elixir dave@pragprog.com"} ] |
| | |
| | def fetch(user, project) do |
| | issues_url(user, project) |
| | |> HTTPoison.get(@user_agent) |
| | |> handle_response |
| | end |
| | |
| | def issues_url(user, project) do |
| | "https://api.github.com/repos/#{user |
Read now
Unlock full access