According to my host: I can confirm that file_get_contents and allow_url_fopen are enabled.
Then I tried your suggestion.
Code:
public function authorize(){
if($this->input->is_ajax_request()) {
echo "This is an Ajax request\n";
$json = json_decode($this->input->raw_input_stream);
var_dump($json);//NULL
var_dump(json_decode(trim(file_get_contents('php://input')), true));//NULL
}
}
I am also using the headers you suggested, see screen shot.
Any other ideas?
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)
(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.