Skip to content

Commit

Permalink
Delete puts
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrogq committed Jan 30, 2018
1 parent 8c106a7 commit 7dcae24
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions lib/alexa/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require "base64"
require "openssl"
require "digest/sha1"
#require "faraday"
require "time"
require "uri"
require "net/https"
Expand Down Expand Up @@ -58,11 +57,11 @@ def getSignatureKey(key, dateStamp, regionName, serviceName)
def request
url = "https://" + Alexa::API_HOST + Alexa::API_URI + "?" + query
uri = URI(url)
puts "Making request to:\n#{url}\n\n"
req = Net::HTTP::Get.new(uri)
req["Accept"] = "application/xml"
req["Content-Type"] = "application/xml"
req["x-amz-date"] = timestamp

req = Net::HTTP::Get.new(uri)
req["Accept"] = "application/xml"
req["Content-Type"] = "application/xml"
req["x-amz-date"] = timestamp
req["Authorization"] = authorization_header

Net::HTTP.start(uri.host, uri.port,
Expand All @@ -87,10 +86,6 @@ def headers
}
end





def uri
URI.parse("http://#{Alexa::API_HOST}/?" + query + "&Signature=" + CGI::escape(signature))
end
Expand Down Expand Up @@ -150,9 +145,6 @@ def authorization_header
SIGNATURE_ALGORITHM + " " + "Credential=" + access_key_id + "/" + credential_scope + ", " + "SignedHeaders=" + headers_lst + ", " + "Signature=" + signature;
end




# escape str to RFC 3986
def escapeRFC3986(str)
return URI.escape(str,/[^A-Za-z0-9\-_.~]/)
Expand Down

0 comments on commit 7dcae24

Please sign in to comment.