htmx
htmx copied to clipboard
[Question] Option to override xhr request with call to my SDK
I understand htmx works best with REST but in my case there is black box SDK in between, therefore I am trying to override beforeRequest to handle form submission with my SDK, wrap it with HTML response and then proceed as normal, can it work?
htmx.on("htmx:beforeRequest", async function(evt){
const response = await window.my_sdk(evt);
return `<h1>${response}</h1>`
})