bigskysoftware/hypermedia-systems-old

Bulk Delete Should Use A Method Other Than Delete?

Closed this issue ยท 2 comments

๐Ÿ‘‹ I didn't see a contributing.md or equivalent file, but noticed that BulkDelete is using hx-delete and it feels like it should be using something else for maximum compatibility with different frameworks. I've been following along in go's standard library. Go doesn't read the payload body of a DELETE request. Maybe it's better to use hx-get or something else? I did verify that python/flask code included is able to read the payload body with a DELETE request. However, based on the way that the book is written, shouldn't it side on being more backend agnostic? Maybe a small blurb would suffice that the payload body might be dropped if you stray from the stack mentioned in https://github.com/bigskysoftware/hypermedia-systems/blob/23afdf3732b12762db47420f4af16a1c29129ed9/book/CH03_BuildingASimpleWebApplication.adoc?plain=1#L24?

Maybe it would be helpful to add to this passage a reference back to the earlier discussion of hx-delete. hx-post is probably the most compatible path, and htmx shows what could be if more http methods were available.

1cg commented

i think hx-delete is correct, but htmx submits the body of a delete as form-encoded

this is technically out of spec, but most server side frameworks accept it. unfortunately, go is one of the frameworks that does "the right thing" by the spec, so it doesn't work out of the box w/ go

we are going to fix htmx's behavior (and likely break things for other people) in htmx 2.0