Skip to content
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 to submit form parameters as "URL encoded" #107

Closed
gunnarmorling opened this issue Jan 2, 2020 · 5 comments
Closed

Allow to submit form parameters as "URL encoded" #107

gunnarmorling opened this issue Jan 2, 2020 · 5 comments

Comments

@gunnarmorling
Copy link

When adding up-target="..." to a form, UnPoly will POST it with content type "multipart/form-data", also if enctype="application/x-www-form-urlencoded" is declared on the form.

@triskweline
Copy link
Contributor

triskweline commented Jan 10, 2020

We're using multipart/form-data since that allows us to transfer all kinds of form values, even binary blobs.

Our server-side web framework (Rails) unpacks request params into the same format regardless of the [enctype]. I thought that other frameworks would handle this similarily. Does your web application rely on a particular encoding type?

@gunnarmorling
Copy link
Author

I'm using Java's JAX-RS (via its implementation RESTEasy) and indeed methods receiving URL-encoded forms looks different from ones receiving multipart forms. In any case, wouldn't it be more in the spririt of the standard to use the content type specified for the form?

@OLibutzki
Copy link

OLibutzki commented Nov 17, 2020

I stumbled upon the same issue. Our backend behaves differently for multipart/form-data and application/x-www-form-urlencoded. In my opinion unpoly would strengthen its non-invasive nature by respecting the form's enctype.

@OLibutzki
Copy link

Are there any chances that unpoly uses the form's enctype? Unfortunately I'm not familiar with CoffeeScript, so I fear I'm not able to contribute.

@triskweline
Copy link
Contributor

This is fixed in Unpoly 2, which was released today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants