bik
7 years agoOccasional Contributor
Trying to send a attachment in POST request
Below is the Curl .
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' {"type":"formData"} 'http://domain/users/users/import'
While doing this am getting a 400 Bad Request.
The request body is as below but all are optional parameter.
{
"user": "string",
"Time": "2018-06-25T09:50:43.461Z",
"Data": "string",
"FileName": "string",
"Status": "string",
"TotalUsers": 0,
"UnassignUsers": 0,
"UniqueUsers": 0,
"UpdatedUsers": 0,
"UserLogId": 0
}
After selecting the Media-Type as multipart/form-data ,attaching xml file and hitting post in SoapUI.
The problem is solved now.
The file will be provided as parameter in SoapuI and then a path of the file.
and then attach the file and hit on POST.