Skip to main content
Participant
June 24, 2015
Answered

Sending a file over http POST

  • June 24, 2015
  • 1 reply
  • 4135 views

I am having trouble figuring out how to send a pdf file to the /transientDocuments REST API. In what format should it be in? what do I need to include in the headers and body? I can never find a clear answer.

This topic has been closed for replies.
Correct answer tylern68939392

I figured it out! I will post the solution for others looking.

In order to send a pdf over HTTP /POST, I set the header to have the access token. However, I set the body to be

"-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=${fileBase64}\r\nContent-Type: application/pdf\r\n\r\n\r\n-----011000010111000001101001--"

Where the 'fileBase64' variable is my file that I converted into a Base64 string.

I also set the Content-Type to be "multipart/form-data; boundary=---011000010111000001101001"

I was able to figure it out by using Postman application to observe what was sent between the Adobe server and the application. Postman also had sample code in Java (and many other languages) that proved to be invaluable when I was trying to figure out a solution.

Hope this helps someone else.

1 reply

tylern68939392AuthorCorrect answer
Participant
June 25, 2015

I figured it out! I will post the solution for others looking.

In order to send a pdf over HTTP /POST, I set the header to have the access token. However, I set the body to be

"-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"File\"; filename=${fileBase64}\r\nContent-Type: application/pdf\r\n\r\n\r\n-----011000010111000001101001--"

Where the 'fileBase64' variable is my file that I converted into a Base64 string.

I also set the Content-Type to be "multipart/form-data; boundary=---011000010111000001101001"

I was able to figure it out by using Postman application to observe what was sent between the Adobe server and the application. Postman also had sample code in Java (and many other languages) that proved to be invaluable when I was trying to figure out a solution.

Hope this helps someone else.