for app <- [:hackney, :ibrowse, :httpc], true == Code.ensure_loaded?(app) do
defmodule ExVCR.Record do defstruct options: nil, responses: nil end
defmodule ExVCR.Request do defstruct url: nil, headers: [], method: nil, body: nil, options: [], request_body: "" end
defp match_response(response, keys, recorder_options) do
match_by_url(response, keys, recorder_options)
and match_by_method(response, keys)
and match_by_request_body(response, keys, recorder_options)
and match_by_headers(response, keys, recorder_options)
and match_by_custom_matchers(response, keys, recorder_options)
end
req_body = URI.encode_query(%{"name" => "who am i", "pass" => "$3cret"})
HTTPoison.post(
"http://www.example.com/login",
req_body,
%{"Content-Type" => "application/x-www-form-urlencoded"}
)