19.08.2018 Views

sqs-dg-2009-02-01

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Amazon Simple Queue Service Developer Guide<br />

Making Query Requests<br />

Making Query Requests<br />

Topics<br />

• Structure of a GET Request (p. 14)<br />

• Structure of a POST Request (p. 15)<br />

• Related Topics (p. 16)<br />

Amazon SQS supports Query requests for calling service actions. Query requests are simple HTTP or<br />

HTTPS requests, using the GET or POST method. Query requests must contain an Action parameter<br />

to indicate the action to be performed. The response is an XML document that conforms to a schema.<br />

Structure of a GET Request<br />

This guide presents the Amazon SQS GET requests as URLs, which can be used directly in a browser.<br />

The URL consists of:<br />

• Endpoint—The resource the request is acting on (in the case of SQS, the endpoint is a queue)<br />

• Action—The action you want to perform on the endpoint; for example: sending a message<br />

• Parameters—Any request parameters<br />

The following is an example GET request to send a message to an SQS queue.<br />

http://<strong>sqs</strong>.us-east-<br />

1.amazonaws.com/123456789<strong>01</strong>2/queue1?Action=SendMessage&MessageBody=Your%20Message%20Text<br />

&AWSAccessKeyId=0GS7553JW74RRM612K<strong>02</strong>EXAMPLE&Version=<strong>2009</strong>-<strong>02</strong>-<strong>01</strong>&Expires=2008-<strong>02</strong>-<br />

10T12:00:00Z&Signature=lBP67vCvGlDMBQ1do<br />

fZxg8E8SUEXAMPLE&SignatureVersion=2&SignatureMethod=HmacSHA256<br />

Important<br />

Because the GET requests are URLs, you must URL encode the parameter values. For example,<br />

in the preceding example request, the value for the MessageBody parameter is actually Your<br />

Message Text. However, spaces are not allowed in URLs, so each space is URL encoded as<br />

"%20". The rest of the example has not been URL encoded to make it easier for you to read.<br />

To make the GET examples even easier to read, this guide presents them in the following parsed format.<br />

http://<strong>sqs</strong>.us-east-1.amazonaws.com/123456789<strong>01</strong>2/queue1<br />

?Action=SendMessage<br />

&MessageBody=Your%20Message%20Text<br />

&AWSAccessKeyId=0GS7553JW74RRM612K<strong>02</strong>EXAMPLE<br />

&Version=<strong>2009</strong>-<strong>02</strong>-<strong>01</strong><br />

&Expires=2008-<strong>02</strong>-10T12:00:00Z<br />

&Signature=lBP67vCvGlDMBQ1dofZxg8E8SUEXAMPLE<br />

&SignatureVersion=2<br />

&SignatureMethod=HmacSHA256<br />

Note<br />

In the example Query requests we present in this guide, we use a false AWS Access Key ID and<br />

false signature, each with EXAMPLE appended. We do this to indicate that you shouldn't expect<br />

API Version <strong>2009</strong>-<strong>02</strong>-<strong>01</strong><br />

14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!