mirror of
https://github.com/dkam/paapi.git
synced 2025-12-27 22:54:52 +00:00
Require net/http and set the body to JSON
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
require 'net/http'
|
||||
require 'aws-sigv4'
|
||||
|
||||
module Paapi
|
||||
@@ -105,7 +106,7 @@ module Paapi
|
||||
request = Net::HTTP::Post.new(uri)
|
||||
request.content_type = 'application/json; charset=UTF-8'
|
||||
headers.each { |k, v| request[k] = v }
|
||||
request.body = body
|
||||
request.body = body.to_json
|
||||
req_options = { use_ssl: uri.scheme == 'https' }
|
||||
Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
|
||||
http.request(request)
|
||||
|
||||
Reference in New Issue
Block a user