I want to upload an image (jpeg or png) which is stored locally to an REST API with the “POST Request” Node. In Postman, I’ve “developed” a PoC which also works, so the API itself seems to be OK. Authentication is done by a Bearer, works well. The content of the POST request is a piece of JSON data and the image, “Content-Type” in the header is (and must be) set to “multipart/form-data”.
Whats not working: I do not get the file up to the server, Statuscode 422. The node itself does not gives back a detailed error message (sadly).
Does anyone here has a working example of this node together with multipart form-data?
Or any hints on how to put the image into this node in a way it is accepted? I’ve already tryed it with “Files to binary object” node with or w/o Base64 encoder afterwards. In Postman, everthing works as long as I set in body the key “file” to type “file” (not text).
D’oh This shouldn’t be difficult to fix though. You mention that you have a Bearer token. You’d need to additionally supply this as input column to the HTTP Retriever with a column named Authorization which contains a string value Bearer xxxxxxxxxxxxxxx. Then select it in the Headers tab as follows and it will be sent as HTTP header: