lib/rquest/requestor.rb in rquest-1.0.4 vs lib/rquest/requestor.rb in rquest-2.0
- old
+ new
@@ -102,9 +102,12 @@
@http_client.use_ssl = true if @uri.scheme == "https"
end
def set_headers
set_cookies if @cookies.any?
+ if @settings[:form_type] == :json
+ @http_request_client["Content-Type"] = "application/json"
+ end
@headers.each do |key, value|
@http_request_client[key.to_s] = value.to_s
end
end