Open timwis opened 9 years ago
Hmmm, the request()
wrapper in the underlying jarvus-apikit package should be taking care of this: https://github.com/JarvusInnovations/jarvus-apikit/blob/master/src/util/AbstractAPI.js#L85
A suffixed content-type might deter it though
response.getResponseHeader('Content-Type')
is undefined
for some reason, even though the HTTP response clearly provides a content type of application/json
Maybe the API for reading headers changed in extjs6 On Aug 9, 2015 3:12 PM, "Tim Wisniewski" notifications@github.com wrote:
response.getResponseHeader('Content-Type') is undefined for some reason, even though the HTTP response clearly provides a content type of application/json
— Reply to this email directly or view it on GitHub https://github.com/JarvusInnovations/jarvus-postgrest-apikit/issues/1#issuecomment-129226920 .
Weird, it looks like the server isn't returning the Content-type
response header when done via Ext.js, but when I do it in a REST client it does return them
Nevermind, that's the pre-flight OPTIONS
request. The actual OPTIONS
request that follows does include Content-Type: application/json
in the response headers. Perhaps Ext.js is getting the responses mixed up?
If you specify
fetchRemoteFields
in your model, the response includes a non-parsedresponseText
object that needs to be parsed intoresponse.data
in order to access its columnsI resolved this using
But you'd probably want to perform a check of some sort before doing that (did the request work, is it actually json, etc.)