Skip to content

Commit

Permalink
upgrade HTTPoison to 0.8.0, replace exjsx with Poison
Browse files Browse the repository at this point in the history
  • Loading branch information
zolazhou committed Nov 27, 2015
1 parent 08468e0 commit c17a132
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/consul/agent/service.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Consul.Agent.Service do
@spec register(map, Keyword.t) :: Endpoint.response
def register(%{"Name" => _} = body, opts \\ []) do
build_url([@agent, @service, @register], opts)
|> req_put(JSX.encode!(body))
|> req_put(Poison.encode!(body))
end

@spec deregister(binary, Keyword.t) :: Endpoint.response
Expand Down
2 changes: 1 addition & 1 deletion lib/consul/catalog.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule Consul.Catalog do
@spec deregister(map, Keyword.t) :: Endpoint.response
def deregister(%{"Datacenter" => _, "Node" => _} = body, opts \\ []) do
build_url([@catalog, @deregister], opts)
|> req_put(JSX.encode!(body))
|> req_put(Poison.encode!(body))
end

@spec nodes(Keyword.t) :: Endpoint.response
Expand Down
2 changes: 1 addition & 1 deletion lib/consul/request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule Consul.Request do
end

def process_response_body(body) do
case JSX.decode(body) do
case Poison.decode(body) do
{:ok, decoded} ->
decoded
_ ->
Expand Down
7 changes: 3 additions & 4 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ defmodule Consul.Mixfile do
def application do
[
applications: [
:httpoison,
:exjsx
:httpoison
],
mod: {Consul, []},
env: [
Expand All @@ -28,8 +27,8 @@ defmodule Consul.Mixfile do

defp deps do
[
{:exjsx, "~> 3.0"},
{:httpoison, "~> 0.6.0"},
{:poison, "~> 1.5.0"},
{:httpoison, "~> 0.8.0"},
]
end

Expand Down

0 comments on commit c17a132

Please sign in to comment.