I configured my app.yaml like this:
- url: /data
static_dir: templates/data
http_headers:
Content-Type: application/json
As seen here at GAE config yaml
I do an AJAX request to get the JSON;
I have a 1KB “sic.json” there, properly formed (I checked…)
When I run dev_appserver,
Using Chrome developer tools, I see the return response as type:
Content-Type:application/octet-stream
When I retrieve these results in jQuery/Javascript, the string is not recognized as JSON;
if forces me to use JSON.Parse first…
But when I actually deploy, the app yaml configuration seems to work; it serves the static file as JSON so JSON.Parse is unnecessary…
Should I expect this, that dev_appserver doesn’t do the same as live deployment as far as serving http_headers for files?
I’m not sure
Content-Typeis one the headers meant to be specified withinhttp_headers. Assuming you don’t have anything else concerning templates/data dir that would imply otherwise in app.yaml, the following will work as expected: