Amazon MWS API with R


I am trying to get data from Amazon MWS API using GetMatchingProductForId operation. When I use Amazon MWS Scratchpad it works perfectly fine.

I am now trying to replicate the urls that are sent in the HTTP POST request but I get a Signature error message. I need to understand how the url request should be structured.

Below is the detail of the request in Amazon MWS Scratchpad, I ANONYMIZED private identifiers but that is the only thing I changed:


POST /Products/2011-10-01?AWSAccessKeyId=ANONYMIZED
&IdList.Id.1=9781933988665 HTTP/1.1
x-amazon-user-agent: AmazonJavascriptScratchpad/1.0 (Language=Javascript)
Content-Type: text/xml

String to Sign



Now my question is, (and let's imagine my signature was created correctly), from the HTTP POST, what should the request look like ? Here is my attempt:

But what about '\n' escape characters that are in the scratchpad ? and what about 'HTTP/1.1' at the end, should I include that also ?

Thanks for your help.