Unable to upload file via HTTP request

In postman, I can upload files like this

I tried the following two methods and failed.

Key is the file name and I can’t delete it.


I tried the put method again and succeeded! But the premise is to set Auth in authentication.

QQ截图20220517152124

If I write in headers, I will report an error. Using the put method, I must regenerate the signature before each upload

The attempt to use the Axios method also failed

Hi @duttchasel, sorry to hear you’re having trouble here. This is unfortunately the expected behavior and it has confused me more than once as well :frowning:

You’d need to return a JSON object in the headers field using an expression rather than write a JSON string. This earlier post of mine has an example of how such an expression could look like. You should be able to adjust this to your needs.

The workaround with the expression works.
Can’t I upload via post? If so, I will use the put method, although it is very unfriendly

This should also work with the POST method, not only PUT.

What I encountered in the post is not the header problem, but the inability to carry more parameters when sending binary data, such as:

QQ截图20220517170049
QQ截图20220517170025

I need to upload like this in postman:

QQ截图20220517170129

I see where you’re going. Yes, that’s unfortunately a limitation of the HTTP Request node.

So such a request would require writing custom code in the Function node at the moment. @RicardoE105 provided an example here which you might want to check out:

I know what to do, thanks!

1 Like