Alright, working on getting amplify decoders. Strange issue. If I have a beforeSend attached to my request, the decoder does not fire. remove the beforeSend and the decoder fires.
Here are the two examples.
- With no beforeSend.
http://jsfiddle.net/sujesharukil/Td2P4/12/
- With beforeSend
http://jsfiddle.net/sujesharukil/Td2P4/14/
Can someone tell me what is happening? why wouldnt the decoder work if I have a beforeSend? I am assuming the decoder should fire after the request is received, so beforeSend should not have any impact on it!
note: stackoverflow wants me to post code here, not just fiddles
//please check the fiddles
amplify.request({
resourceId: "testRequest",
data: {
json: JSON.stringify({
text: 'hello world'
})
},
success: function(data, status) {
console.log(data, status);
$('.messages').append('<div> text retrieved: ' + data.text + '</div>');
},
error: function(status, xhr) {
console.log(xhr);
}
});
Help?
-Suj