This is a single archived entry from Stefan Tilkov’s blog. For more up-to-date content, check out my author page at INNOQ, which has more information about me and also contains a list of published talks, podcasts, and articles. Or you can check out the full archive.

Shame on you, Amazon ...

Stefan Tilkov,

for releasing the shittiest “REST” API in a long time. What complete ignorant came up with this API to SimpleDB?

The following shows a REST request that puts three attributes and values for an item named Item123 into the domain named MyDomain.

    https://sdb.amazonaws.com/?Action=PutAttributes
&DomainName=MyDomain
&ItemName=Item123
&Attribute.1.Name=Color&Attribute.1.Value=Blue
&Attribute.2.Name=Size&Attribute.2.Value=Med
&Attribute.3.Name=Price&Attribute.3.Value=14.99
&AWSAccessKeyId=<valid_access_key>
&Version=2007-11-07
&Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQE=
&SignatureVersion=1
&Timestamp=2007-06-25T15%3A01%3A28-07%3A00
On December 16, 2007 12:48 AM, Gresco said:

Stefan, I am a new to REST style. Would you mind sharing with us what could be the right way of designing the above URL? Some pointers would be much appreciated too. Thanks.

On December 16, 2007 2:41 AM, Jason R Briggs said:

Somebody didn’t bother to learn the basics. I do hope there’s an equivalent DeleteAttributes action. Something that you can provide as a link on a page…. ;-)

On December 16, 2007 9:07 AM, Stefan Tilkov Author Profile Page said:

Gresco, as it happens, I can point you to this: http://www.infoq.com/articles/rest-introduction

On December 16, 2007 3:34 PM, Phillip Ghadir said:

Actually, the URL is almost as neat as it could be, isn’t it? :-) Or do you see any difference to:

https://sdb.amazonaws.com/MyDomain/Item123/Attributes
&Color=Blue
&Size=Med
&Price=14.99
&AWSAccessKeyId=
&Version=2007-11-07
&Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQE=
&SignatureVersion=1
&Timestamp=2007-06-25T15%3A01%3A28-07%3A00

Probably I’d drop the part Attributes in the URL …

I’m not sure about Version parameter. Maybe one would encode it into the URL directly.

In the end it boils down to the criticism on the action encoding in the url instead of identifying a resource that’s accessed via standard methods, and on the misuse of the parameters for building key-value-pairs like ‘attribute.<no>.name’ and ‘attribute.<no>.value’ instead of using parameters directly.

Do I miss something else?

On December 16, 2007 4:33 PM, Stefan Tilkov Author Profile Page said:

I think that just about covers it - and I consider it bad enough.

On an unrelated note, this day will get a red mark in my calendar :-)

On December 17, 2007 12:14 PM, Hendrik Schreiber said:

…just because Phillip left a comment in your blog? ;-)