Delete Request with body

#1

Dear all,

How can I make a DELETE Request with body ?

Thank you!

Sharafutdinov Ruslan

0 Likes

#2

A body in a DELETE request doesn’t have any defined semantics. Most servers will either reject the request or at least ignore the body.

0 Likes

#3

@SharafutdinovRuslan
I’m facing a similar issue, that the API I’m trying to access requires some semantics in JSON format for a DELETE request. I’ve also already worked with APIs which expect the PATCH method.

In both cases, I ended up setting up my Python environment, doing “pip install requests” and then creating a “Python Script (1=>1)” node within the KNIME workflow with this basic code (In this example, I used PATCH to update certain key-value pairs in an API), which can be modified to your specific needs:

Furthermore, to make this work, I placed the Python Script within a Loop so that it can iterate over multiple rows like this (chunk size = 1):
PATCH_loop

Hope this helps.

2 Likes