API DELETE but with data

Hello,

My API is requesting data when performing DELETE request. Please see example below

curl --request DELETE \
     --url https://website.test.com/dtable-server/api/v1/dtables/2345525/rows/ \
     --header 'accept: application/json' \
     --header 'authorization: Bearer key' \
     --header 'content-type: application/json' \
     --data '
{
  "row_id": "test",
  "table_name": "test"
}
'

However, adding data does not seem to be available in WeWeb for the DELETE request (it is for other requests though).

How would I achieve this?

Mmm… great question. I’m not sure that’s possible right now.

Have you tried adding the key value pairs as query strings by any chance?

Hello @Joyce and thank you for answering my question.

I have tried and it does not seem to work.

I must say that this feature is extremely important to us as without this we cannot finish our project and therefore we cannot switch from another provider to WeWeb.io

BTW I really like your video tutorial videos.

Axel

Hi @Axel

Ok, thanks for giving it a try. Let me follow up with the tech team and get back to you on this one :slight_smile:

And thank you for the kind words about the video tutorials! Appreciate it!

Is using a custom javascript step an option?

e.g.

await fetch(
  "https://website.test.com/dtable-server/api/v1/dtables/2345525/rows/", 
  {
    method: "DELETE", 
    headers: {
      accept: 'application/json',
      authorization: 'Bearer key',
      header: 'content-type: application/json'
    },
    body: JSON.stringify({
      row_id: 'test',
      table_name: 'test'
    }
  }
)

You can replace any of the above with variables as you see fit. For the developer, it’s ergonomically not as much fun as using the nocode form, but its doing the same thing as the form under the covers.

We often work on these kinds of pushing-the-envelope no-code and low-code cases in our daily State Change office hours.

Thank you for your help @raydeck but I will pass for now and wait until this feature is available on WeWeb before switching. I would just like to point out that this feature is available on other platforms such as Bubble. Also, this is possible for other API verbs on WeWeb such as PUT.

Switching from what? Are you currently using another platform for your work? (You mentioned bubble)

Hi @Axel :wave:

I created the product ticket internally for the tech team to explore but note that it may not be something we choose to develop because sending a body with a DELETE call is not a recommended or widely supported practice in web development.

Here’s an article on the topic in case you’re interested:

Hello @Joyce thank you for your help. I understand that including a body in a DELETE request is not recommended practice. However, the software we use for our backend does use it and we are stuck with this.

@raydeck we currently use bubble.io

We were hoping to switch to weweb because it offers the option for selfhosted solution.

Axel

2 Likes

Yeah, I understand. You can still do it in WeWeb but, for now at least, you’ll need to resort to JavaScript as @raydeck recommended :confused:

1 Like

FWIW (and perhaps for other viewers of this thread) a major advantage of WW is the ease with which one can drop in and out of javascript for the hard bits. This is in contrast to other systems (I think in particular of Bubble), which might have more first-party “legos” but the escape hatches are harder.

1 Like