I am having issues with running a collection data file.
[{
“ordername”:“BZ2345”,
“orderno”:123456,
“thedate”:“2021-02-26”
}
]
my data file contains this exact code, and is called orders.json
when i try to run a collection with my json post request i get an unsupported media type error. but if i copy what is inside of the json file and run it in my request it runs fine.
You are trying to pass this as a data file and have you declared the data variables accordingly? Because from the previous message I understood that you are trying to pass this JSON as the entire body for the POST request? If so why are you passing the file here?
i am trying to pass a data file and i have declared the variables as seen above. when i try to pass the file it says the file is an unsupported media type. but the file is a .json and the information in the file is json. and when i just put the contents of the file inside of the body of the request the request takes the information fine
Okay I get that, I used the same file for Postman echo collection. It is working as expected. And Can you please check the headers you have added? Probably something wrong there. If there’s something wrong with the JSON file you will getting different error something related to parsing the file. Possibly share the header screenshot, else try to verify against the spec.