Correct MIME type for JSON?

Possible duplicate:
What is the correct JSON content type?

I have a problem on json, it only displays "Content-Type: text / html". I am testing on localhost and my online code is

header('Access-Control-Allow-Origin: *');

header('Content-Type: application/javascript');
//header('Content-type: text/javascript');
//header('Content-type: application/json');
+6
source share
3 answers

use this

header('Content-type: application/json');

for JSONdata

+3
source

Media Type application/jsonfor JavaScript Object Notation (JSON)

header('Content-type: application/json');

choose it from IANA

good reading:

Application Media Types

+1
source

MIME Type for JSON application/json

+1
source

All Articles