I'm having a problem with Firefox's debugging panel, spcecifically on the Network tab; when a POST request sends some JSON, it shows the request body inside a tree-like viewer; while this viewer is cute and everything, I actually need to copy and paste the actual raw JSON text into another tool.
There doesn't seem to view the actual JSON request from this panel. Does someone know of some way of viewing the actual RAW JSON inside it?
After some fumbling around, I found out that if you right-click the request, the browser gives you the option to copy the post data (which would return the JSON, if it is a POST) or to "Edit and resend", which would open a dialog that, among other things, has the JSON itself.
Related
A little startup I am doing work for is searching for a JavaScript Org Chart, and we believe we'd like to use "GetOrgChart" from getorgchart.com.
We definitely have a working back-end already that provides data to the front-end via RESTful services and provides JSON data.
We know the GetOrgChart can be loaded with data from various sources, and in this case we'd like to know what format the JSON has to be in?
Are there any examples out there of how the JSON should look like?
We'd definitely like to download and register this product, but that is one of the questions we'd like to get answered.
Thanks!
On their demos page, you can click the 'Get HTML Code' link (upper right, below the site header) which opens the javascript used to render the demo, including the format of the data.
I would like to visualize data from csv file at node-red ui.
What I would like to do is to show behind a flag of a country the countity from the csv file. So into the csv file I have 2 columns (country, quantity).
Because of I am new at node-red I would like to get some hints how to do that.
Thanks in advance.
my flow with CSV data
Welcome to Node-RED!
Firstly you need to decide what kind of UI you would like. Node-RED has options for a number ranging from the creation of data driven web pages using the http-in/out and template nodes through the more dynamic but slightly more complex Dashboard through to full-power dynamic web-apps using things like node-red-contrib-uibuilder.
The very simplest approach is to use an http-in and an http-out node to define a web page. Then to add your file reader after the http-in then the CSV node (which turns the CSV data into JSON). Then you could use node-red-contrib-tableify to turn your JSON into an HTML table. Finally use the template node to insert the table into the html that the http-out node sends back to the browser.
http-in -> file read -> csv -> tablify -> template -> http-out
Once you've mastered that, you could go on either to smarten up the template or swap to using Dashboard or even uibuilder depending on your needs.
I have to create a web page first, right?
You define the URL in the http-in node. When the -in is connected to the -out, you have a "page". Albeit with no content. To create content you can use the template node. In fact, pushing the csv data through the tablify node and into the template would give you enough of a page to see the data. The templatate itself need only be:
<pre>{{payload}}</pre>
Though, of course, you can also wrap that with other HTML elements as needed. But that alone should be enough to render something useful.
How can I trigger the http-in?
You simply reference the URL from your browser. So if you set the http-in node to use URL /fred and you used a browser on the same device that is running Node-RED, you would use the URL http://localhost:1880/fred in your browser.
How should I design the web page to be able to put the information from the csv file into it by the http-out node?
The tablify node does that for you.
String together what I've outlined and you should see something that will let you go further.
I suggest just using http-in, template and http-out nodes to start so that you can see how they work together. Then feed in your data without the csv or tablify nodes, then add the csv and finally the tablify. That way you can see how things work.
There's an online tool that I'd like to tweak. It depends upon a JSON file. The easiest way for me to make the changes that I desire is to edit this JSON file directly, which I'm doing using the "Edit text" feature of Chrome DevTools. Next, I need to reload the main webpage so that it fetches the edited JSON file. Of course, this doesn't work because the webpage fetches the resource from the server. Is there any way to make the webpage temporarily load my edited JSON file?
I'm working on functional testing of a REST API using Jmeter and JSON. I've got file uploading working but I cant seem to get the file downloading to work in jmeter. I'm saving the response as noted in this post: JMeter - File upload and file download scenario
When I do this, I am getting close but not quite exactly what I need. This is and example of what I am getting:
--0rVAdzesdQq7VrwJaRoYGm_UHdMD5nhi9_5w4u
Content-Disposition: form-data; name="api-test"; filename="LIBFILE1.txt"
Content-Type: text/plain
Content-Transfer-Encoding: binary
Library File for Automated Smoke Test
This file is used to test file library upload for automated smoke tests.
--0rVAdzesdQq7VrwJaRoYGm_UHdMD5nhi9_5w4u--
How can I get the download to only save the file contents? In this example, it should only be:
Library File for Automated Smoke Test
This file is used to test file library upload for automated smoke tests.
This is a simple textfile. I would also like to download the other formats that I'm uploading including jpg, png, docx, pdf but it wont be right if it has this extra data coming with it. I figure once I get a simple text file working, it will help me get the more difficult file types.
Well, Save Responses to a file listener will store the data you can observe in the "Response Data" tab of the View Results Tree listener. If you see these Content-Type, Content-Disposition, etc. headers as response data - most probably your upload wasn't successful as you should not be getting the headers this way.
I would recommend double checking that the same request being executed via browser or i.e. Postman tool returns the same response and fix your JMeter script in case of differences.
See Performance Testing: Upload and Download Scenarios with Apache JMeter article for details on how to properly mimic file operations with JMeter.
Alternative way of saving response data into a file is using JSR223 Listener, given you select "groovy" in the language dropdown you should be able to save the response using the following simple script:
new File("/path/to/your/file.txt").setBytes(prev.getResponseData())
I'm writing an iOS app which will eventually retrieve data in JSON from a web service. However, before I get the web service running, I just want to test the app's ability to retrieve the JSON, so I thought I could simply upload a dummy JSON file (.json) to the root of a website I have hosted, point my browser to that file's URL and view (or at least download) the JSON.
Unfortunately, when I try to navigate to the JSON file's URL in my browser, I get the message
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
If I use the same URL in Postman I get a different response:
The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
I realise I'm doing something stupid here and probably fundamentally misunderstanding something, but after quite a lot of Googling I don't know what! Everybody else with similar issues seems to reporting that they're prompted to download the JSON file rather than just seeing the data displayed in their browser, but I'm not even getting that. It'd be fine if I was! For what it's worth, I've verified the JSON itself in JSONLint.