i have a webservice and a web interface for registered user. this section allow the user to get their statistics (similar to stack overflow)
now this tool i have allow the user to retreive their data in a json format, my problem is the header sent is not working for all the browsers
i have:
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 00:00:00 GMT');
header('Content-type: text/json');
should i remove the expires and cache control?
The commonly accepted MIME for json is application/json
.
You should use:
header('Content-type: application/json');
See also: What is the correct JSON content type?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With