0

I have a json file url.

When I access it in the browser it says to download it. I tried prepending the url with view-source: but it is only viewable in the FF browser and no other browser.

So I need something that I can append or prepend to the url so that the JSON file is viewable in any given browser.

Charlie Puth
  • 131
  • 8
  • It depends on the header `Content-Type` being specified: Possible duplicate question so perhaps this will help: https://stackoverflow.com/questions/4064444/returning-json-from-a-php-script – sativay Mar 23 '21 at 12:47
  • 1
    Does this answer your question? [Returning JSON from a PHP Script](https://stackoverflow.com/questions/4064444/returning-json-from-a-php-script) – sativay Mar 23 '21 at 12:47
  • I test a json file url in localhost and it only shows download when clicked in IE. It opens directly in Chrome and Edge. Please provide [a minimal code snippet](https://stackoverflow.com/help/minimal-reproducible-example) which can **reproduce the issue**. Besides, you can also refer to [this thread](https://stackoverflow.com/questions/9888861/view-json-file-in-browser) to use addons. – Yu Zhou Mar 24 '21 at 03:10
  • Firefox has built-in JSON viewer, but _as far as I know_ chromium based browsers doesn't, that's why. – Mehdi Dehghani Mar 28 '21 at 06:35

0 Answers0