-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow user to override Content-Type header #1906
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need a couple tests to validate the new and old behavior.
I will add them within the next week |
Oh, also, needs to be retargeted against |
Yeap, i will change that after we find a solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to remove the two unrelated changes (@Telroshan is correct about splitting up unrelated PRs) and then we're good to go.
www/content/api.md
Outdated
@@ -58,7 +58,7 @@ or | |||
* `handler` - a callback that will handle the response HTML | |||
* `target` - the target to swap the response into | |||
* `swap` - how the response will be swapped in relative to the target | |||
* `values` - values to submit with the request | |||
* `values` - values to submit with the request (json object, not an array) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one as well
src/htmx.js
Outdated
@@ -3301,7 +3302,7 @@ return (function () { | |||
}); | |||
}); | |||
triggerEvent(elt, 'htmx:beforeSend', responseInfo); | |||
var params = useUrlParams ? null : encodeParamsForBody(xhr, elt, filteredParameters) | |||
var params = useUrlParams ? null : encodeParamsForBody(xhr, elt, filteredParameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this change
Terrific, thank you! |
beauty |
I'm using a 3rd party js library (openstreetmap) which returns me a
veryComplexObject
which i need to make an ajax request. At the moment htmx.ajax overwrites theContent-Type
. With this commit we can do use anyContent-Type
we want.This works great. But it would be cool if we had more control over of some (if not all) htmx properties like
hx-push-url
.