Haensel/ActiveResource — pull request #19 by leandrok (2013-11-14 16:26:03+00:00)
Title: Api Key (token) support and assign returned response values to model attributes

Dear Johannes,

First of all, congratulations for your excellent work! Your extension has been very useful for us.

I work for a company that use the PostmarkApp service. First, we created some Yii classes to handle their REST API, but we found that your extension is a far cleaner and better way to handle this and we migrated to use your extension.

However, we performed two changes in order to support that API, and we want contribute our changes if you agree (any suggestion will be very welcome):

1) Postmarkapp don't use the normal auth mechanism. They use a special token in the header (X-Postmark-Server-Token, please see http://developer.postmarkapp.com/developer-build.html). Therefore, we added an apiKey configuration to optionally configure a token name and a token value.

2) After send a POST request (using save()) Postmarkapp returns some information in a JSON response. Although your component automatically updates the idProperty (MessageID for Postmark) we need also update other properties, so we added a change for that too.

Thank you very much.

Regards,
Leandro