Created
January 30, 2018 05:20
-
-
Save SirECMG/1ff737eda5aeacf793990648b82c773b to your computer and use it in GitHub Desktop.
Trying to get HTTPoison running
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ElixirBart.MixProject do | |
use Mix.Project | |
def project do | |
[ | |
app: :elixir_bart, | |
version: "0.1.0", | |
elixir: "~> 1.6", | |
start_permanent: Mix.env() == :prod, | |
deps: deps() | |
] | |
end | |
# Run "mix help compile.app" to learn about applications. | |
def application do | |
[ | |
extra_applications: [:logger] | |
] | |
end | |
# Run "mix help deps" to learn about dependencies. | |
defp deps do | |
[ | |
{:httpoison, "~> 1.0"} | |
# {:dep_from_hexpm, "~> 0.3.0"}, | |
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}, | |
] | |
end | |
end | |
defmodule ElixirBart do | |
HTTPoison.Base | |
@moduledoc """ | |
Documentation for ElixirBart. | |
""" | |
@doc """ | |
Hello world. | |
## Examples | |
iex> ElixirBart.hello | |
:world | |
""" | |
def hello do | |
:world | |
end | |
def call_api() do | |
HTTPosion.start | |
HTTposion.get! "http://httparrot.herokuapp.com/get" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment