Delete requests cause 400 without reaching worker

When using a DELETE request, I am getting 400 responses and the worker is not handling the request. GET, POST, and PUT all work fine. I am using itty-router https://github.com/kwhitley/itty-router. I am also using wrangler 2.8.1 and running it with hosted dev mode. Example response:
HTTP/1.1 400 Bad Request
server: cloudflare
date: Wed, 01 Feb 2023 02:48:54 GMT
content-type: text/html
content-length: 155
cf-ray: -
Connection: close

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
HTTP/1.1 400 Bad Request
server: cloudflare
date: Wed, 01 Feb 2023 02:48:54 GMT
content-type: text/html
content-length: 155
cf-ray: -
Connection: close

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
I could not find anything online about issues with either workers or itty router with DELETE requests.
2 Replies
Walshy
Walshy•2y ago
How are you doing the delete request?
DanTheGoodman
DanTheGoodmanOP•2y ago
### Delete machine mappings
DELETE http://127.0.0.1:8787/manage/machines/delete
Content-Type: application/json
id: testid
ak: a

{
"machineID": "mac_id",
"events": ["test2", "test3"]
}
### Delete machine mappings
DELETE http://127.0.0.1:8787/manage/machines/delete
Content-Type: application/json
id: testid
ak: a

{
"machineID": "mac_id",
"events": ["test2", "test3"]
}
using vs code rest client extension @walshydev just in case you didn't get a notif 😄
Want results from more Discord servers?
Add your server