The Api is working when I'm using the form-data but the same is not working when I'm using raw JSON. How can we convert form data to raw json with boundary?enter image description here
Related
When running a Postman requests through Collection runner by passing the values contain in a CSV file for the input parameters, how can I validate each response contain the String text mentioned in the expected value column in this CSV file. I also want to write each response to the Actual result column in this CSV file.
For example after executing the 1st request in the above pic using the Postman collection runner I want to validate the response contains 'Sydney' as a text value and give the result as 'PASS' or 'FAIL' as well as write the actual response to the Actual result column of the above file. This should continue till the last row of the CSV file.
You can access the data in the CSV using the data dictionary, for example data.Scenario.
Checkout this article, chapter "Data variables in pre-request and test scripts".
I don't think it is possible to write data back to the CSV file.
I am using an API that gives me response in this format :
{'captchaId': '11655487', 'code': '644SD843ADSH48678 (just some letters and numbers)'}
Looks like JSON but it uses different quotes.
Does anyone know what format is it??
I'm trying to parameterize a url in Postman and loop over that list to call multiple APIs one after another and append the JSON bodies.
For example:
if the url is GET https://location/store/{{user_id}}/date
and
user_id = ['1','3','5','2','6','8']
then how do I store user_idas a variable such that request can loop over each user_idin the url and generate an appended JSON body?
You can use data files. Store the user id values into a csv or JSON file and call that file in to your collection runner. The headers of the csv files can be used as variables names. please see the details of this approach in the below link
https://learning.postman.com/docs/postman/collection-runs/working-with-data-files/
In Rails 3, how can I pass thumbnail image as Byte Array to JSON?
For converting images to text you could convert it to base64.
Check out:
ruby:
http://ruby-doc.org/stdlib-1.9.3/libdoc/base64/rdoc/Base64.html
jquery:
http://archive.plugins.jquery.com/project/base64
UPDATE:
How to encode media in base64 given URL in Ruby
I have a URL that returns data in CSV format. I would like to use Google Vizualization to create an interactive chart of the data. I've looked at several examples on Google Chart and Vizualization web page but I'm a bit confused as I'm not familiar with JavaScript or web programming in general.
Question: Do I have to use JavaScript to parse the CSV string myself and manually construct the DataTable with addColumn() and addRows()? Or, is there a way to simply pass the CSV url to the charting function? I'm hoping to do something like this:
var csv_data = get_data_from_url('http://...')
var data = new google.visualization.DataTable(csv_data);
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, ...);
Can someone please help me out?
Thanks.
Yeah, it looks like they're using JSON or some close variant of JSON for the data. You could try a CSV to JSON converter. Apparently converting CSV to JSON is a fairly trivial operation, requiring only a few lines of code:
converting CSV/XLS to JSON?