module Gorillapi::CurlBuilder
Public Instance Methods
accept()
click to toggle source
# File lib/gorillapi/curl_builder.rb, line 14 def accept "-H \"Accept: #{accept_header}\"" end
add_params()
click to toggle source
# File lib/gorillapi/curl_builder.rb, line 22 def add_params "-d '#{params.to_json}'" unless params.nil? || params.empty? || params == '' end
content_header()
click to toggle source
# File lib/gorillapi/curl_builder.rb, line 18 def content_header "-H \"Content-Type: #{content_type}\"" end
host()
click to toggle source
# File lib/gorillapi/curl_builder.rb, line 26 def host "http://#{url}#{path}" end
request_string()
click to toggle source
# File lib/gorillapi/curl_builder.rb, line 4 def request_string <<-EOF curl -X #{request_method} -k -i -v #{content_header} #{accept} #{authorization} #{add_params} #{host} EOF end