I'm following the the Java sample code (from SampleAttachFileToResource.java) for uploading an attachment using the SDM REST API (version 17.1), using Postman, but continue to receive the cryptic BadRequest response with no idea of what is "bad" with my request. If anyone can help me understand what I'm missing, it would be greatly appreciated.
Here is what I'm sending via Postman:
--*****MessageBoundary*****Content-Disposition: form-data; name="payload"Content-Type: application/xml; CHARACTERSET=UTF-8
<attmnt><repository id="1002"></repository><orig_file_name>test.txt</orig_file_name><attmnt_name>test.txt</attmnt_name><description>Upload using REST</description></attmnt>
--*****MessageBoundary*****Content-Disposition: form-data; name="test.txt"; filename="test.txt"Content-Type: application/octet-stream
Here's the header info:
POST /caisd-rest/attmnt?repositoryId=1002&serverName=ivs-sdm2&mimeType=Text&description=test.txt HTTP/1.1Host: sdm.someserver.org:8051X-AccessKey: 30769721Content-Type: multipart/form-data; BOUNDARY=*****MessageBoundary*****Cache-Control: no-cache
I think that the "Content-Transfer-Encoding: binary" parameter in the multipart file is missing.
Isn't this the same question as in
and so already answered ?
Yes, The question is the same, but the last answer was very generic, it refers to the use of the api rest, my answer is more specific with respect to the test that does mnx and what is missing for the requirement to work, which is to add the parameter Content-Transfer-Encoding, at least I did not need to add the characters "/ r", attached example image.