LabVIEW Web Development Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending a body with DEL http method

Hello,

 

Let me start with this is my first project using http requests, so I apologize if I use the incorrect terminology.

 

I am required to send a DEL request, but include information in the body of the request. I was already successfully using GET and POST (including a body with POST). I see that there isn't a control input into the GET.vi in Data Communication->Protocols->HTTP Client. Does anybody have experience with including a body in a DEL request?

0 Kudos
Message 1 of 3
(2,561 Views)

Hello Community,

 

I have the same problem. As an example I want to communicate with ThingSpeak. I'm able to write data using the GET and the POST method. If I want to delete the channel data, I need to use the DELETE method. This is defined as follows (found here: https://de.mathworks.com/help/thingspeak/clearchannel.html )

 

ThingSpeak - Clear Channel.png

 

ThingSpeak - Clear Channel - Postman.png

 

What I've done so far is the following:

ThingSpeak - Clear Channel - G Code.png

 

But the body data is not a header, as I tried it (and so this gives an error message).

So what I need is a HTTP Delete function, which accepts body data.

Or is there existing a VI which stores body data associated with the HTTP Handle so I can define body data before executing the HTTP Delete function?

 

I attached the code I used as an llb. To get it to work you need a ThingSpeak account.

 

 

Greets, Dave
0 Kudos
Message 2 of 3
(833 Views)

Hi Dave,

 

This is a number of years old for me, but I wanted to follow up. I believe that I never got a direct solution for this. Luckily the tool that I was communicating with was a company internal tool and they changed the spec to conform to my ability to not include a body.

 

Looking around, I see some places saying that a DEL should not have a body. See updated answer in the following:

https://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request

0 Kudos
Message 3 of 3
(827 Views)