FIX: Incorrect way to use Excon in `DiscourseHub`.

This commit is contained in:
Guo Xiang Tan 2017-06-20 08:32:45 +09:00
parent 394efb3290
commit 8dbe2c3ec4
1 changed files with 3 additions and 2 deletions

View File

@ -51,8 +51,9 @@ module DiscourseHub
def self.collection_action(action, rel_url, params={})
JSON.parse(Excon.send(action,
"#{hub_base_url}#{rel_url}",
body: params,
headers: { 'Referer' => referer, 'Accept' => accepts.join(', '), 'Content-Type' => 'application/json' }
body: URI.encode_www_form(params),
headers: { 'Referer' => referer, 'Accept' => accepts.join(', '), "Content-Type" => "application/x-www-form-urlencoded" },
omit_default_port: true
).body)
end