问题
Is it possible to send a messaging request to Amazon's SQS directly from javascript? I'm trying to create a logging system and would love to bypass sending the request to a middleman server. Also, does anybody know of any alternatives to this solution that I may leverage?
回答1:
SQS(and as a matter of fact all aws services) expose REST based apis. You can directly make a http request to the SQS REST api through javascript code. The api documentation id given here.
回答2:
Unless you load your Javascript from the same SQS domain as you're trying to send to then no, due the clients/Javascript Same-Origin Policy you wont be able to cross post to SQS.
Your best bet is to use a middle-man server of your own.
来源:https://stackoverflow.com/questions/8393845/possible-to-send-request-directly-to-amazon-sqs-from-http-javascript-client