I was just trying that, it seemed not to be working for some reason.
I manually copy-pasted the source code into my app, and got:
htmx.min.js:1 TypeError: Cannot set property 'Content-Type' of undefined
at Object.encodeParameters ((index):11)
at htmx.min.js:1
The code for it is:xhr.requestHeaders['Content-Type'] = 'application/json'
But I believe it should be
xhr.setRequestHeader('Content-Type', 'application/json')
When I do this, it seems to work
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequ...