Log message #4223042

# At Username Text
# Jan 20th, 11:18 HumanG33k https://paste.debian.net/1126781/ @challgren with your request
# Jan 20th, 11:07 challgren curl -XPOST -H ‘Accept: application/json’ -H “Content-type: application/json” -d ‘{“country”: {“name”: “England”}}’ ’https://ensd3uvg3k4ui.x.pipedream.net/'
# Jan 20th, 11:05 challgren Data comes across just fine
# Jan 20th, 11:05 challgren https://requestbin.com/r/ensd3uvg3k4ui/1Wem9MrblAFjfL6hA5fudBXXEWC
# Jan 20th, 11:04 challgren curl -XPOST -H ‘Accept: application/json’ -H “Content-type: application/json” -d ‘{ “country”: { “name”: “England” } }’ ’https://ensd3uvg3k4ui.x.pipedream.net/'
# Jan 20th, 11:03 HumanG33k @challgren with the two header there is an exeption
# Jan 20th, 10:59 challgren Plus the json your sending isn’t even properly formatted
# Jan 20th, 10:57 challgren curl -i -H “Accept: application/json” -H “Content-Type: application.json” -X POST -d “{‘country’: {‘name’: ‘England’}}“;
# Jan 20th, 10:56 challgren Ok well you just changed the accepts you need a Content-Type so cake knows you are sending json and not text/plain
# Jan 20th, 10:56 HumanG33k but nothing change @challgren
# Jan 20th, 10:45 HumanG33k of json
# Jan 20th, 10:45 HumanG33k i fix typo
# Jan 20th, 10:43 challgren You should also be sending Content-Type: application/json in your headers
# Jan 20th, 10:36 challgren https://book.cakephp.org/4/en/controllers/middleware.html#body-parser-middleware
# Jan 20th, 10:36 challgren Or you can use the Body Parser Middleware
# Jan 20th, 10:35 challgren https://www.php.net/manual/en/function.json-decode.php has the arguments listed
# Jan 20th, 10:34 challgren If you look at the code it calls the first argument of the input function and then passed the body as argument 1 and the rest of the arguments as 2,3,4, etc
# Jan 20th, 10:32 challgren try $this->request->input(‘json_decode’, true);
# Jan 20th, 10:30 HumanG33k and its look like whatever i test even without option it s look like the $jsonData is null
# Jan 20th, 10:26 HumanG33k ?
# Jan 20th, 10:26 HumanG33k ["as" => 'array']
# Jan 20th, 10:25 HumanG33k @challgren there is no more information than in the book in the source code. so i not really know how to use the "as array" option for input('json_decode')
# Jan 20th, 10:12 HumanG33k ok maybe it can be a good thing to fix it. No doc == less user andand more requests here (i guess)
# Jan 20th, 10:08 challgren Which is why the api docs havent been updated
# Jan 20th, 10:08 challgren Best to use an IDE and “Go to deceleration” I know apigen has issues with PHP 7.2
# Jan 20th, 10:07 neon1024 You can browse the source for the api documentation, as the html is parsed from the souce afaik
# Jan 20th, 10:05 HumanG33k there is no v4 api documentation ?
# Jan 20th, 10:04 HumanG33k @challgren where can i found the $this->request->input options list ?
# Jan 20th, 09:59 marek.sebera While setting up tests, is it possible to generate fixtures for all models, without manually specifying each one?
# Jan 20th, 09:56 HumanG33k i need to change it to arry
# Jan 20th, 09:55 HumanG33k @challgren error 500
# Jan 20th, 09:52 val What would be the best approach in overriding QueryBuilder in 3.x?
# Jan 20th, 09:49 challgren https://book.cakephp.org/4/en/controllers/request-response.html#xml-or-json-data
# Jan 20th, 09:44 challgren Hold please
# Jan 20th, 09:44 HumanG33k yes
# Jan 20th, 09:44 challgren Wait are you on 4?
# Jan 20th, 09:44 challgren Drop the country object and just do name
# Jan 20th, 09:43 HumanG33k and this is the curl request
# Jan 20th, 09:43 HumanG33k curl -i -H "Accept: application/json" -X POST -d "{'country': {'name': 'England'}}";
# Jan 20th, 09:41 HumanG33k @challgren https://paste.debian.net/1126761/ the data value
# Jan 20th, 09:40 alexdd55976 morning fellows