404 error returned from valid URL from Amazon Route 53

madz

New Member
I am trying to use Amazon's Route 53 server API from "classic" ASP but when I post the request I get back 404 error even though the URL sent is valid if I paste it into a browser. Is Classic ASP not capable of calling Route 53 or is there an error in my code:\[code\]Dim linebreak, gmt, timestamp, urlparams, amazonserver, stringtosign, signature, signedURL, sha256const versionDate="2009-07-01"amazonserver="https://route53.amazonaws.com/2012-02-29/xxxxxxxxxx"linebreak=chr(13)const secretkey="my secret key"gmt=DateAdd("H", 0, Now)timestamp = return_RFC822_Date(Now(), "GMT")set sha256=GetObject("script:"&Server.MapPath("sha256.wsc"))stringtosign = timestampsignature=sha256.b64_hmac_sha256(secretkey, stringtosign)header = "AWS3-HTTPS AWSAccessKeyId=ky access id,Algorithm=HMANSHA256,Signature="&signatureSet sha256=nothingsignedURL=amazonserver&"/onca/xml?"&urlparams&"&Signature="&Server.URLEncode(signature)response.write signedURLSet xmlHttp = Server.Createobject("Microsoft.XMLHTTP")xmlHttp.Open "POST", signedUrl, False response.write strURL&"<br>"xmlHttp.setRequestHeader "User-Agent", "asp httprequest"xmlHttp.setRequestHeader "Host", "route53.amazonaws.com"xmlHttp.setRequestHeader "content-type", "text/plain" xmlHttp.setRequestHeader "X-Amzn-Authorization", signaturexmlHttp.Send() if xmlHttp.Status >= 400 And xmlHttp.Status <= 599 Then response.write "Error Occurred : " & xmlHttp.Status & " - " & xmlHttp.statusText else getXML = xmlHttp.responseText end ifxmlHttp.abort()set xmlHttp = Nothing \[/code\]
 
Back
Top