• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Sending a file over http POST

Community Beginner ,
Jun 24, 2015 Jun 24, 2015

Copy link to clipboard

Copied

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.

Views

3.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jun 25, 2015 Jun 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; bounda

...

Votes

Translate

Translate
Community Beginner ,
Jun 25, 2015 Jun 25, 2015

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines