Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question/How-To: best practice for getting response headers from rest call? #402

Open
jimlears opened this issue Oct 1, 2014 · 3 comments

Comments

@jimlears
Copy link

jimlears commented Oct 1, 2014

what's the best way to get access to the response headers from a REST call with the following conditions?

  1. no custom DataAdapter*
  2. using app.fetch()
  3. bypassing apiProxy with absolute urls

*this is causing Browserify issues currently and, I hope, there has to be a better/easier way to get at those headers without a lot of custom code.

@saponifi3d
Copy link
Contributor

@jimlears - looking into this issue a bit i noticed that Backbone does this: http://stackoverflow.com/questions/20425491/get-response-headers-after-backbone-fetch-is-complete

It looks like we could return the data in the same way, would that fit the bill for everything you need?

@jimlears
Copy link
Author

jimlears commented Oct 8, 2014

@saponifi3d I wish, but that won't work server side

@saponifi3d
Copy link
Contributor

@jimlears yeah - i think one of the biggest problems is that it would need to return the headers for multiple requests as well.

My current though is I can add an additional parameter that is an array of request objects that you can then access the header information in (should be formatted the same way between server / client). Looks like we could do that in the shared/fetcher.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants