Amazon SQS supports Query requests for
calling service actions. Query requests are simple HTTP
requests, using the GET or POST method with query parameters in the
URL. Query requests must contain an Action parameter to indicate the action to be performed; otherwise, they are considered REST requests. The
response is an XML document that conforms to a schema. You
might use Query requests when a SOAP toolkit is not available for
your platform, or when Query requests are easier to make than
a heavier SOAP equivalent.
SQS Query requests are URLs. The URL consists of
The following is an example Query request to send a message to an SQS queue:
http://queue.amazonaws.com/A29E9VSPHGOG23/queue1?Action=SendMessage&MessageBody=Your%20Message%20Text&AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE&Version=2007-05-01&Expires=2007-05-12T12:00:00Z&Signature=lB/P67vCvGlDMBQ1dofZxg8E8SU=
Because the above format is hard to read, all Query examples in this guide are presented in the following parsed format:
http://queue.amazonaws.com/A29E9VSPHGOG23/queue1 ?Action=SendMessage &MessageBody=Your%20Message%20Text &AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE &Version=2007-05-01 &Expires=2007-05-12T12:00:00Z &Signature=lB/P67vCvGlDMBQ1dofZxg8E8SU=
The first line represents the endpoint of the request. This is the resource the request acts on. The example above acts on a queue (as opposed to an individual message in a queue), so the request's endpoint is the queue's identifier, known as the queue URL. For more details about the queue URL, see About the Queue URL.
After the endpoint is a question mark (?), which separates the endpoint from the parameters. Each parameter is separated by an ampersand (&).
The Action parameter indicates the action to perform on the requested endpoint. The actions correspond to Query API operations. The other parameters that are common to all Query requests are listed in Common Request Parameters.
![]() | Important |
|---|---|
Because Query requests are URLs, you must URL encode the parameter values. For example, in the example request above, the value for the |