Hi,
if i select a json file in a collection/Runner in Data
it returns: error when parsing file.
What i wrong with the json file?
The content of the file is:
{
“data”: [
{
file1: "file.txt",
file2: "file2.txt"
},
{
file1: "file3.txt",
file2: "file4.txt"
}
]
}
It needs to be an array so a structure like this:
[
{
"userId": 1
},
{
"userId": 2
}
]
More information can be found here:
Hi @danny-dainton ,
when importing json file it returns error if it contains:
[
{
"file1": "c:\temp\file.txt",
"file2": "c:\temp\file2.txt"
}
]
It accepts if json contains:
[
{
"file1": "file.txt",
"file2": "file2.txt"
}
]
I need to put the path for the file.
i found more explanation here:
Update: If you want to dip deeper into the Postman Collection Runner, check out this newer post about Postman’s Collection Runner. Postman’s Collection Runner is a powerful tool. As its name implies, the Collection Runner (CR) lets you run all...
Est. reading time: 6 minutes
To use that, you need to escape the \
characters:
[
{
"file1": "c:\\temp\\file.txt",
"file2": "c:\\temp\\file2.txt"
}
]
Yes i tried but it send the path with \
Postman can’t find the file with \ nor // or /
That’s just a string value its not the same as you selecting form-data
and then specifying a file location on your system.
yes i see it’s just a string and different from selecting form-data specifying a file location.
Here when i preview the json file after importing, it already shows with \ and in the request body the path comes with double \ then it returns error because it cannot find the file.
You might need to add example images of the things you can see, to bring the information to life
1 Like
system
(system)
Closed
December 12, 2024, 12:57pm
11
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.