How to set Form-data in Rest Message ( attaching a file )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2016 10:39 AM
Hey guys,
I have everything set up and running the only issue is how to set the request of the rest message to ( -F ) form-data
My curl look like this.
curl https:/<endpoint url>/content \
-H "Authorization: Bearer ACCESS_TOKEN" -X POST \
-F attributes='{"name":"tigers.jpeg", "parent":{"id":"11446498"}}' \
-F file=@myfile.jpg
this is what causing the problem !!! the body of the request must be set to -F ( form data )
-F attributes='{"name":"tigers.jpeg", "parent":{"id":"11446498"}}' \
-F file=@myfile.jpg
setContent() did not work
.
Any help is appreciated!!
regards
Nagendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 01:40 PM
multipart/form-data is not supported for outbound REST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2016 07:55 PM
multiple/form-data is supported. I tested this with HP TRIM for sending files and It worked.
You have to use the following..
Accept = application/json
Content-Type = multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Authorization = <if any>
Content =
----WebKitFormBoundary7MA4YWxkTrZu0gW
<Your content>
----WebKitFormBoundary7MA4YWxkTrZu0gW--
Boundary not needed for your post but was required for me to integrate with HP TRIM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 03:15 PM
I can confirm this working as well !!
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2017 09:40 PM
I came across the same issue a couple years ago and I ended up writing a small .jar file and deployed it to the Mid server. Passed in the binary and other parameters from a script include to the mid server. Worked great. Java can do this very easily.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 09:52 AM
I know it's been a few months, but could you show an example of the .jar file script?