Is it possible to send and store a csv file stored in my computer to an external endpoint using a POST/PUT request in Postman?
I have tried selecting ‘form-data’ in the body, file type as key and selecting the csv file as its value. Additionally, I have selected ‘multipart/form-data’ as the Content-Type under Headers.
When I try this I get the following error;
{
“message”: “Invalid JSON in body of request”,
“reason”: null
}
Yes, it’s possible to send a CSV file from your computer to an endpoint using Postman.
Your approach with form-data is correct. However, the error suggests the server is expecting a JSON payload, not a file. Here’s a quick guide:
Headers: Remove the manual Content-Type header. When using form-data, Postman should set this for you, ensuring the correct boundaries are appended.
Server Expectations: Double-check if the endpoint truly expects a file or if it’s geared towards JSON payloads. It might be helpful to consult the API documentation or the backend team.
Postman Console: It offers a detailed view of the sent request. It might help identify any mismatches.