Displaying a file instead of downloading it |
Displaying a file instead of downloading it |
Loonatic |
Oct 5 2016, 08:36 AM
Post
#1
|
Group: Members Posts: 5 Joined: 15-June 16 Member No.: 24,325 |
Good day to all,
Im trying to do a health check webpage, which is checking a few URL for specific wording and displaying the results. Here is my issue, I am having some problems with some of the URL which return a file to download instead of displaying it in the browser. When i enter my URL, it ask me to either open or save. In console with cURL, i am able to display the data with a command similar to this : curl -XGET 'http://localhost:9000/monitor/health?nice=true' The result look like this QUOTE { "name" : "localhost", "status" : "red", "timed_out" : false, "number_of_nodes" : 1, "number_of_data_nodes" : 1, "active_primary" : 1, "active_vm" : 5, "relocating_vm" : 0, "initializing_vm" : 1, "unassigned_vm" : 4 } How can i get my webpage to display or echo this result ? Any help will be appreciated. |
Christian J |
Oct 5 2016, 10:20 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
Im trying to do a health check webpage, which is checking a few URL for specific wording and displaying the results. What are you using to check those URLs? A scripting language, iframes, Ajax? QUOTE I am having some problems with some of the URL which return a file to download instead of displaying it in the browser. When i enter my URL, it ask me to either open or save. See the answer to this FAQ question: http://htmlhelp.com/faq/html/links.html#force-download QUOTE In console with cURL, i am able to display the data with a command similar to this : curl -XGET 'http://localhost:9000/monitor/health?nice=true' The result look like this Is that a javascript object? In that case you also need a script that can use it. Perhaps you can load it with a SCRIPT element, like this: CODE <script src="http://localhost:9000/monitor/health?nice=true"></script> <script> // something that uses the embedded JS goes here </script> Or you might use Ajax to send the GET request. |
Lo-Fi Version | Time is now: 18th April 2024 - 07:33 PM |