• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSON not display in browser  RSS feed

 
Durga Roobini
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have JSON which as response from third party server,i call the URL and i want to print in browser as json but it is not display browser also display well in console i post my code here


output in browser
============

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

XML document must have a top level element. Error processing resource 'http://localhost:8080/MindPulpy1/JsonToXml'.

and also

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

A semi colon character was expected. Error processing resource 'http://localhost:8080/MindPulpy1/JsonToXml'. Line 10, Posi...

"canonicalUrl": "/v1/products?format=json&apiKey=9uvqqsjvwxc4c4ferw922k7k",
-----------------------------------------...
like error showing

output in console
===========
{"total":19,"movies":[{"id":"771312513","title":"Captain America: The Winter Soldier","year":2014,"mpaa_rating":"PG-13","runtime":136,"critics_consensus":"Suspenseful and politically astute, Captain America: The Winter Soldier is a superior entry in the Avengers canon and is sure to thrill Marvel diehards.","release_dates":{"theater":"2014-04-04"},"ratings":{"critics_rating":"Certified Fresh","critics_score":94,"audience_score":99},"synopsis":"Steve Rogers continues his journey as the super-powered American soldier who's grasping to find his place in a modern world after being frozen in ice....

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hard to say, as we know neither the code that display something in a browser, nor do we know the JSON that seems to cause the issue.
 
Paul Clapham
Sheriff
Posts: 22509
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently the browser thinks you are sending it XML. So, what MIME type did you tell the browser to expect?
 
Durga Roobini
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i try this also but no response mime_body_part.setHeader("Content-Type", "application/json"); and remove the xml from content type
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!