Hello,
I need to send a pdf file to an API with a multi part request. But with the service pub.client:http I can't send string and bytes data. I have an error when I doing this.
In the documentation of pub.client:http service I can read this for data/bytes :
Important: When you use bytes and another element (args, table, or string) to specify data, the service appends the data from the args, table, or string element to url. The service appends args to url first, table second, and string last. The service encodes the data from the bytes element in the body of the post.
As a result, my multipart string is send in the url and I have this error :
java.io.IOException: Illegal character in query at index 75: https://apupier.dev.notilus-tne.cegid.cloud/public/api/imports/invoice/pdf?
------------WmFormBoundary.BSDS15RmiY7PMqda
Content-Disposition: form-data; name="guidInvoiceImport"
1ba19381-cb78-459e-b196-04d9ed90779d
------------WmFormBoundary.BSDS15RmiY7PMqda
Content-Disposition: form-data; name="file"; filename="Test5.pdf"
Content-Type: application/pdf
------------WmFormBoundary.BSDS15RmiY7PMqda--
How can I resolve this issue and send the data correctly ?
Regards,