mikehostetler / amplify

AmplifyJS
http://amplifyjs.com
GNU General Public License v2.0
1.45k stars 143 forks source link

Access sender/current request in decoder #62

Closed eirikhm closed 12 years ago

eirikhm commented 12 years ago

I'd like to have access to the invoked request/resource in a decoder. As far as I can tell this is currently not supported, but should be easy to implement. Passing request, settings and ajaxSettings to decoder() probably.

Any chance for this happening?

scottgonzalez commented 12 years ago

What's the use case?

On Tue, Jun 5, 2012 at 3:39 AM, Eirik Hoem < reply@reply.github.com

wrote:

I'd like to have access to the invoked request/resource in a decoder. As far as I can tell this is currently not supported, but should be easy to implement. Any chance for this happening?


Reply to this email directly or view it on GitHub: https://github.com/appendto/amplify/issues/62

scottgonzalez commented 12 years ago

This was discussed in IRC. The use case really calls for creating a new request type, not providing request details to the decoder.

steve-heine commented 10 years ago

I'm working with a REST endpoint and don't have control the format of the response data. (its not my library). The response structure is similar for all calls, but the names of the objects depend on the resource. JSend wont work for me so I planned on creating a custom decorder. Since each response has its own response object names. I was planning on defining this in the request definition, and then access that value in the decoder. Is this possible?