Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 3.1.8 JSON Post fails
#5

(05-13-2018, 12:39 PM)jreklund Wrote: Have you tried grabbing another source/website with file_get_contents() to confirm it's actually activated?
Have you tried making a POST without https? In case your Cross-Origin Resource Sharing (CORS) are set wrong. Don't know if this actually apply to Postman thought.
Do you have the latest Codeigniter?
Do you have the latest PHP version? (7.1 or 7.2)

My PHP version is .7.0.28
Codeigniter version is 3.1.8
The following code snippet works.

PHP Code:
<?
    var_dump(json_decode(trim(file_get_contents('php://input')), true));
?>

Posting {"user":1} gives me:
array(1) {
  ["user"]=>
  int(1)
}

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
Codeigniter 3.1.8 JSON Post fails - by pigfox - 05-12-2018, 08:58 PM
RE: Codeigniter 3.1.8 JSON Post fails - by pigfox - 05-13-2018, 10:58 AM
RE: Codeigniter 3.1.8 JSON Post fails - by pigfox - 05-13-2018, 02:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB