Select to view content in your preferred language

DELETE method in Network Request

1000
4
08-27-2020 09:56 PM
SeanKim
Occasional Contributor

Hi all,

I have encountered something interesting situation which might be the bug or I am wrong in implementing.

The situation is, I am using App Framework Network Request to get relevant data from the server-side. In order to do that, I found that 'DELETE' method is not accepted raw body as below.

networkRequest.url = some_url

networkRequest.method = "DELETE"

networkRequest.send(JSON.stringify({"keyA":"valueB"})

in the above case, there no body has sent.

But, it'll be in when I change its method as 'POST' as below.

networkRequest.url = some_url

networkRequest.method = "POST"

networkRequest.send(JSON.stringify({"keyA":"valueB"})

I also checked that it's working(but it's not raw body) when I set as form-data as below.

networkRequest.url = some_url

networkRequest.method = "DELETE"

networkRequest.send({"keyA":"valueB"})

Have a check and let me know if you any.

Sean

Tags (2)
0 Kudos
4 Replies
ErwinSoekianto
Esri Alum

Sean, 

The documentation outlines that "DELETE" method is supported. And on the send(body) method, it indicates that you could supply a JSON object as the parameter to assist the request. NetworkRequest QML Type | ArcGIS 

Thank you,

Erwin. 

0 Kudos
SeanKim
Occasional Contributor

Hi Erwin,

Thanks for your reply.

However, I have still encountered a problem using DELETE method with JSON as a raw. Below attachments showing what I've tested for this issue. It's captured from the Filddler and tested with same source code and environment. Just difference is method. POST/DELETE

As you can see, there's a missing body in DELETE method while the POST method works as expected.

Thanks.

Sean.

0 Kudos
ErwinSoekianto
Esri Alum

Sean, 

I see! I think you have enough testing and reproducible case to report this as a defect. Would you help us to submit this as an official defect through Esri Technical Support‌ so that it will get appropriately logged and prioritized? 

Thank you,

Erwin 

0 Kudos
SeanKim
Occasional Contributor

Thanks for the reply. I have requested it.

Sean.

0 Kudos