http: add support for query parameters, use Jason for JSON encoding instead of Poison like everywhere else
This commit is contained in:
parent
646bb87816
commit
2d3241753f
2 changed files with 9 additions and 1 deletions
|
|
@ -31,12 +31,15 @@ defmodule Pleroma.HTTP do
|
|||
process_request_options(options)
|
||||
|> process_sni_options(url)
|
||||
|
||||
params = Keyword.get(options, :params, [])
|
||||
|
||||
%{}
|
||||
|> Builder.method(method)
|
||||
|> Builder.headers(headers)
|
||||
|> Builder.opts(options)
|
||||
|> Builder.url(url)
|
||||
|> Builder.add_param(:body, :body, body)
|
||||
|> Builder.add_param(:query, :query, params)
|
||||
|> Enum.into([])
|
||||
|> (&Tesla.request(Connection.new(), &1)).()
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue