You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the text plugin is being used by the json plugin (correctly or not). unfortunately, some restful servers depend on the accept header to determine the content-type of the response and may default to say, XML.
The issue is that the text plugin exposes no way to set request headers at present.
I know you can hack via config: { text: { onXhr: function(xhr){ ... } } } but the json plugin has no direct access to that. It will be much more useful to change text.get to accept an optional 4th argument headers (obj) and set these on the xhr instance before the open.
This seems fine. I am open to a pull request, however, I would just use if (headers) { and skip the Object check. For the non-xhr paths, it is fine to leave them as they are, since it does not make sense in those cases.
cool. what of fallback to config.text.requestHeaders if no arg? good idea?
can work with CORS etc
On Friday, February 1, 2013, James Burke wrote:
This seems fine. I am open to a pull request, however, I would just use if
(headers) { and skip the Object check. For the non-xhr paths, it is fine
to leave them as they are, since it does not make sense in those cases.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-13007879.
the text plugin is being used by the json plugin (correctly or not). unfortunately, some restful servers depend on the
accept
header to determine thecontent-type
of the response and may default to say, XML.The issue is that the text plugin exposes no way to set request headers at present.
I know you can hack via
config: { text: { onXhr: function(xhr){ ... } } }
but the json plugin has no direct access to that. It will be much more useful to change text.get to accept an optional 4th argumentheaders (obj)
and set these on the xhr instance before the open.A quick hack that worked:
and in json.js just pass as 4th argument.
I'd do a pull request but I cannot figure if this is the best API to do it or how to mimic the same for rhino file stream.
The text was updated successfully, but these errors were encountered: