emberx-xml-http-request
emberx-xml-http-request copied to clipboard
how do you download using this?
the examples only show upload
Every request has an upload and download. I only showed uploads because usually that's higher latency, but you would construct a download in exactly the same way. You're right. The docs should be clearer about this.
does a download still use PUT
?
Is there a way to handle errors? (like 401?)
It uses post by default, but will use whatever verb you bind to the method
param. E.g. method="PUT"
All of the properties of the object are available. Including status
(I think) the reader has all the properties available in each state.
Sent from my iPhone
On May 8, 2016, at 09:18, L. Preston Sego III [email protected] wrote:
does a download still use PUT?
Is there a way to handle errors? (like 401?)
— You are receiving this because you commented. Reply to this email directly or view it on GitHub
So, I could set the method to GET for downloading. cool.
For errors, do I need to put an observer on the status
property? or...? how does that work?
Like, ideally, I'd like to do something like this:
downloadFile().then(success => {}, error => {
this.flashMessages.alert('whatever the error');
});
Right now, this library is geared towards requests that you need to track in your templates, which for us, and as the ticket indicates, is primarily geared towards uploads. We should however add actions for all of the major XHR events.