Answer the question
In order to leave comments, you need to log in
Chrome doesn't display server json response in console
I fill in the url (intended for Ajax) in the address bar, the server's response is displayed on the page. But this is json, and I would like to see it in a parsed form, as is usually the case in the "preview" tab. But there instead "no preview available", "no response data available".
What am I doing wrong?
(well, except that you need to use some plugin to debug Ajax requests)
The server response is something like this:
HTTP/1.0 200 OK
Access-Control-Allow-Headers: accept,origin,x-requested-with,range,x-fields
Access-Control-Expose-Headers: content-range,x-fields
X-Fields: guid,admpath,name
Vary: X-Fields
Content-Range: items 0-91/92
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: OPTIONS,GET
Content-Type: application/json
Content-Length: 26733
Server: Werkzeug/0.9.4 Python/2.7.3
Date: Fri, 15 Nov 2013 01:30:14 GMT
Answer the question
In order to leave comments, you need to log in
Accept: tried to set, does not help.
GET /addr/ HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Cache-Control: no-cache
Accept: application/json
Pragma: no-cache
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: csrftoken=3V2ntHJJHr0v8zXBvcHyX0aYxG4bPzIS
for example, I filter ajax requests by $_SERVER['HTTP_X_REQUESTED_WITH']=XMLHttpRequest, try adding X-Requested-With: XMLHttpRequest to the headers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question