Forum Stats

  • 3,769,814 Users
  • 2,253,026 Discussions
  • 7,875,214 Comments

Discussions

soa 12c: Upload file using rest adapter

ABAB
ABAB Member Posts: 26 Blue Ribbon

Hello,

We have a requirement where we need to upload a pdf file by calling a rest api.

API only accepts 'multipart/form-data' requests with a single PDF named “file” as the only form contents..

Here is an example http request

POST /api/files/ID/pdfs/ HTTP/1.1

Host: abcd.myhost.com

api_key: my_key

Content-Type: multipart/form-data; boundary=----FormBoundaryXXXXXXXX

cache-control: no-cache

Content-Disposition: form-data; name="file"; filename="/path/to/my-file.pdf"

------FormBoundaryXXXXXXXX--

Does rest adapter support multipart/form-data ? If yes then can you please suggest how to achieve it using rest adapter ?

Thanks,

AB    

Answers