Trying to send a attachment in POST request
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there anything more in the response? An error message maybe? Don't you have access to the application's logs? I guess there are many problems that can be signaled by the 400 status response...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HTTP/1.1 400 Bad Request
Date: Mon, 25 Jun 2018 11:17:55 GMT
Server: Apache
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Set-Cookie: JSESSIONID=-BFD1zwe2dw5rQvpPwfFqcjf.hfs-support-service_test_0; Path=/domain
X-Application-Context: application
Connection: close
Transfer-Encoding: chunked
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can't put my finger on it. Again, there can be multiple causes for this. Can't you access the application's logs?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Community,
Is there anybody who faced a similar issue? Could you please help @bik?
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for circling back, @bik, and letting us know that you fixed it and how. 🙂
---
Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another problem happening the same file upload this time .csv which is having issues.
For xml file the upload is working but not for the .csv file ,getting 400 Bad request
