As per title, is it possible to pass a JSON body along with hx-post through an attribute? Or do I have to make it a form to pass data?
Yes, with the official json-enc extension, which "encodes parameters in JSON format instead of url format."
https://htmx.org/extensions/json-enc/
<div hx-post='/test' hx-ext='json-enc'>click me</div>