title: HTTPoison post request
body: <p>I'm using HTTPoison lib for a post request heres my method</p>
  
  <pre><code>def do_request(method, url, body \\ "", headers \\ [], options \\ []) do
    headers = [{"Authorization", "Bearer #{Application.get_env(:app, :access_token)}"}]
  
    case body do
      {:json, json} -&gt;
      headers = [{"Content-Type", "application/json"} | headers]
      body = Poison.Encoder.encode json
  
      {:file, _path} -&gt; true
      _ -&gt; body = []
    end
  
    request!(method, url, body, headers, options) |&gt; process_response
  end
  </code></pre>
  
  <p>calling the method:</p>
  
  <pre><code>body = %{ "account_id" =&gt; "123456" }
  do_request(:post, '/users/get_account', JSX.encode!(body))
  </code></pre>
  
  <p>but i'm getting </p>
  
  <pre><code>** (ArgumentError) argument error
             (jsx) src/jsx_decoder.erl:234: :jsx_decoder.value/4
           (exjsx) lib/jsx.ex:15: JSX.decode!/2
       (httpoison) lib/httpoison/base.ex:413: HTTPoison.Base.response/6
  </code></pre>
  
  <p>any ideas on this issue?</p>