I am trying to upload a csv with header and values.
In the column Body (header), I have below json code as the value.
Body
{
"userId": "q",
"password": "q"
}
I get an error due to non trimmable byte.
"{\"UserId\": \"a\", \"Password\": \"a\"}"
After using escape characters, I was able to upload half of the text only upto comma. (,) but not not the whole text.
Try removing the outside quotes so it starts and ends with the curly brackets.
I have examples of doing this, and I didn’t need to escape anything in the JSON.
I’m assuming your CSV has one header and this should be read in as a single object?
You do need to use JSON.parse when retrieving the iteration data to turn it into a real object, otherwise it will just be treated as a string.
Hi Mike,
thanks for quick reply.
This is my data file with headers and values. For the column Body, I am trying to send the user name and password (everything as a json value).
I tried removing quotes, and it still the same. What ever after the , comma is throwing error.
Could you please help me on this.
What happens if you try and preview that file.
I just tried with ; as the delimiter and it doesn’t seem to work.
I don’t see any options in Postman to select a different type of delimiter.
However, tried it with a basic file with a single header, and got the same issue when saving from standard notepad as UTF-8.
I created a CSV file in Excel, and exported it as UTF-8 and this appeared to work ok.
This is how it looks in Excel.
If I open the file in Notepad++, you can see that Excel has automatically escaped the file for you.
Endpoint,Query,Body
serverapi/Auth/interactive,,"{""UserID"": ""b"",""Password"":""b""}"
I could then add the / slash to serverapi (which I couldn’t do in Excel).
This seems to work as you can see in the following preview.
Hi Mike, you saved me!
Thank you so much for your time and effort.
system
(system)
Closed
September 28, 2024, 4:36pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.