Hi! I’m using Docker version of n8n (0.166.0 release) and trying to understand the DeepL API documentation.
At the moment I see that n8n DeepL node only supports raw text translations. Since I need to send over the file, I see that a custom HTTP request is needed. Could you please help me with configuring POST multipart/form-data request?
DeepL API page says the following:
POST /v2/document HTTP/1.0 Host: api-free.deepl.com User-Agent: YourApp Accept: */* Content-Length: [length] Content-Type: multipart/form-data;boundary="boundary" --boundary Content-Disposition: form-data; name="file"; filename="mydoc.docx" contents of your uploaded document --boundary Content-Disposition: form-data; name="auth_key" <my-auth-key> --boundary Content-Disposition: form-data; name="target_lang" DE --boundary--
What I already configured in the HTTP Request Node:
Authentication: None (Auth key should be provided below)
Request Method: POST request
Next, where does Accept / Content-Length / Content-Type go?
I found the “Body Content Type” option which can be set to “Form-Data Multipart”. But what’s next?
- how the Content-Type: multipart/form-data; boundary=“boundary” part should be set?
- where does all these --boundary items go? Is it a header option?
- finally, how the raw data should be transmitted? I see that “Send Binary Data” can be switched on and the Binary Property = data is activated by default. I made sure that the previous GET HTTP request returns a binary object with the Binary Property = data. So I assume I have the valid document, but I don’t understand how to pass it into “contents of your uploaded document” section?
Thank you in advance for your help!