Log message #4017961

# At Username Text
# Apr 19th 2017, 15:21 crazycoder so i think i must set headers
# Apr 19th 2017, 15:21 crazycoder i get html output
# Apr 19th 2017, 15:21 crazycoder Neon1024, /api/sdfsfsdfsdf.json <---
# Apr 19th 2017, 15:21 crazycoder ok
# Apr 19th 2017, 15:20 Neon1024 Plus it is more inline with jsonapi.org
# Apr 19th 2017, 15:20 Neon1024 I had a requirement to use headers as I wasn’t allowed to use .json
# Apr 19th 2017, 15:19 Neon1024 As Cake allows both .json extension and headers
# Apr 19th 2017, 15:19 Neon1024 If you use a .json extension it should come back as json
# Apr 19th 2017, 15:19 crazycoder *create
# Apr 19th 2017, 15:19 crazycoder i will crate a midleware too
# Apr 19th 2017, 15:19 crazycoder ah ok awesome
# Apr 19th 2017, 15:19 crazycoder ok but after the headers?
# Apr 19th 2017, 15:19 Neon1024 The exception error will be rendered as normal, but json instead of html :)
# Apr 19th 2017, 15:19 Neon1024 To set the headers based on the route for my api
# Apr 19th 2017, 15:18 Neon1024 I’ve used a middleware class
# Apr 19th 2017, 15:18 crazycoder and what will be rendered?
# Apr 19th 2017, 15:18 crazycoder k
# Apr 19th 2017, 15:18 Neon1024 I always get them confused but I think it’s the Content-Type header
# Apr 19th 2017, 15:18 Neon1024 You need to set the header on the response to application/json
# Apr 19th 2017, 15:17 crazycoder Neon1024, how? because if i do website/blablablabla i get the html NOT found page
# Apr 19th 2017, 15:17 Neon1024 I use the default exceptions, but I’ve had to make my own exception renderer to customise the json output
# Apr 19th 2017, 15:17 Neon1024 Yep
# Apr 19th 2017, 15:16 crazycoder Neon1024, is there a way to render the error on a json call?
# Apr 19th 2017, 15:13 sjundee Hi! Anyone who has experience working with CSV? When my title row is the very first line in the file, the first element `$cols[0]` isn't found in `array_search()`. I try `$key_id = array_search('Id', $cols)`, but when it is on the very first line, it doesn't work. When it after the first line, I get what I expect.
# Apr 19th 2017, 15:09 Neon1024 :D
# Apr 19th 2017, 15:09 crazycoder i am working on ubuntu and deploying on ubuntu too
# Apr 19th 2017, 15:09 crazycoder :D
# Apr 19th 2017, 15:04 Neon1024 Not that I did that last week :p
# Apr 19th 2017, 15:04 Neon1024 If like me you develop on Mac OS and go live on Ubuntu
# Apr 19th 2017, 15:04 Neon1024 Otherwise you might put it into production and nothing will work
# Apr 19th 2017, 15:03 Neon1024 I’d also double check that a plugin called ‘API’ works okay on case sensitive file systems
# Apr 19th 2017, 15:03 crazycoder thanks!
# Apr 19th 2017, 15:02 Neon1024 (y)
# Apr 19th 2017, 15:02 Neon1024 Controllers are Capitalised
# Apr 19th 2017, 15:02 crazycoder / <--
# Apr 19th 2017, 15:02 crazycoder that's the problem
# Apr 19th 2017, 15:02 Neon1024 Thirdly
# Apr 19th 2017, 15:02 crazycoder Neon1024, yeah
# Apr 19th 2017, 15:02 Neon1024 Plus, I always tend to prefix my routes with a /
# Apr 19th 2017, 15:02 crazycoder but why? i wrote the action there
# Apr 19th 2017, 15:02 Neon1024 Not sure the plugin name should be all UPPERCASE