PUT Request application/x-www-form-urlencoded

Hello,

I’m trying to make a PUT request to a REST API, it works fine in Postman, but the PUT Request node in KNIME creates a 400 error.

I suspect it’s related to the request body encoding, maybe? The API seem to be very picky about “application/x-www-form-urlencoded”. But not sure if just using a header like this actually does anything (probably not quite so simple):

In Postman:

I can do GET in KNIME with that endpoint just fine, it just doesn’t work with PUT.

Would greatly appreciate some hints. :pray:

Hi,

you’ll need to encode the request body as “form encoded”. In Palladian, there’s a node which allows you to conveniently create the necessary structure which you can then use with the HTTP Retriever:

HTH,
Philipp

1 Like

Thanks @qqilihq for the quick reply.

I can’t quite figure out what the Palladium nodes are doing.

But after some trial and error. Turns out, Python is not picky at all, so i will go with that.

Edit: aaah, it was the line break in the string. It has to be a single line. :man_facepalming:

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.