Commit 0890bd17 by lanrion

refactor http_post headers params

parent 67610f42
......@@ -17,7 +17,7 @@ module WeixinAuthorize
def http_post_without_token(url, payload={}, headers={}, endpoint="plain")
post_api_url = endpoint_url(endpoint, url)
payload = MultiJson.dump(payload) if endpoint == "plain" # to json if invoke "plain"
load_json(RestClient.post(post_api_url, payload, headers))
load_json(RestClient.post(post_api_url, payload, :params => headers))
end
# return hash
......
......@@ -45,7 +45,7 @@ module WeixinAuthorize
end
def http_post(url, payload={}, headers={}, endpoint="plain")
headers = {:params => access_token_param.merge(headers)}
headers = access_token_param.merge(headers)
WeixinAuthorize.http_post_without_token(url, payload, headers, endpoint)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment