문제

My REST Web Service returns a JSON response using the following code:

header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
header("Content-Type: application/json");
echo json_encode($languages,128);

However, when I test the service on my browser - it renders the JSON as HTML. If I inspect the source, I can see HTML tags and everything. What's causing this and how do I fix this?

Raw source code

Response Headers

Thanks.

P.S.: I'm using the Slim Framework, if that makes a difference.

도움이 되었습니까?

해결책

You probably have a browser extension installed that presents JSON as a nicely formatted, human readable HTML document.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top