How to send binary data in invokeurl task?

How to send binary data in invokeurl task?

Hello,

I am using Adobe's Protect PDF API.
Source: https://developer.adobe.com/document-services/docs/overview/pdf-services-api/

Everything works fine in Postman. 

But for some reason after encrypting the file, it is empty after password protecting the PDF. Again, in Postman the file is protected correctly.

cURL in Postman:


curl --location --request PUT 'https://testurl.com' \
--header 'Content-Type: application/pdf' \
--data-binary '@postman-cloud:///1efc4376-bad2-4750-ace1-16715a7e932b'

You can see here that data is passed as binary. Basically the file is being sent like that:


Deluge:

  1. a = invokeurl
  2. [
  3. url :"https://pdfobject.com/pdf/sample.pdf"
  4. type :GET
  5. ];

  6. a=a.getFileContent();
  7. header_map.put("Content-Type","application/pdf");

  8. upload_file = invokeurl
  9. [
  10. url :uploadUri
  11. type :PUT
  12. parameters:a
  13. headers:header_map
  14. detailed:true
  15. ];
  16. a=a.getFileContent();




However I suppose in Deluge it is sending an empty file.

I have used sendmail to see what the variable a is. I can see the PDF without any issues in the email.

But for some reason it's not working in the API call

How can I fix that?