-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Post Request Issue #115
Comments
The This page will give you more info on creating or sending the let form = event.target; // the form element
let formData = new FormData(form); |
I am having a similar issue when trying to send data = {topic: "test"};
var formData = new FormData();
for(var key in data) {
formData.append(key, data[key]);
}
swup.loadPage({
url: "/search",
method: "GET",
data: formData,
}); If I understand things correctly, my FormData var should be set up appropriately, however, the |
I understand your confusion because I've been there some time ago. When sending the GET request, the URL of the request is what matters, not the request data, which makes sense when you think about how the GET requests work... However, I haven't found any "native" way to serialize the form into the URL format, and so, swup builds the URL manually, before appending it to the value defined in form If you do find some better way, please, let me know. :) |
@gmrchk Thanks for that link to the code! Looks like it's just building the string then doing a regular So — correct me if I'm wrong — there's really no reason for me to even bother trying to build the FormData for a
|
Yep. @dougkeeling |
This post is sending '[object Object]' data.
I tried parse object as url variable but content-type variable is still 'text/plain;charset=UTF-8'
The text was updated successfully, but these errors were encountered: