milliparsec icon indicating copy to clipboard operation
milliparsec copied to clipboard

Add form data support

Open v1rtl opened this issue 5 years ago • 7 comments

Forms are very commonly used, so it must be supported

previously we have parsec.form() but it was for urlencoded only, we need a separate function for forms with form data in it

related: #4

v1rtl avatar Aug 30 '20 13:08 v1rtl

Hey @talentlessguy I've stumbled on this issue and was wandering if it's still viable to have a go at it?

If so, can you suggest any pointers about the desired robustness of the solution? form data can be quite complex if I were to follow this: https://www.w3.org/TR/html401/interact/forms.html#h-17.13.3

ilanru avatar Dec 05 '22 09:12 ilanru

@ilanru easiest solution is just being able to parse text fields. if files are doable without introducing new dependencies, even better.

v1rtl avatar Dec 05 '22 09:12 v1rtl

Oh that was quick

Alright, I'll start with text fields and go from there, thanks

ilanru avatar Dec 05 '22 09:12 ilanru

Well, sorry about the long delay, life got in the way.

I've drafted a small pr with the suggested changes: https://github.com/tinyhttp/milliparsec/pull/21

It was not very complex to extract the file fields, but I am not sure what is the proper response structure and how should the files be encoded as at the moment they are converted to simple strings inside the p function.

Here's an example response for files from the implementation, any suggestions would be appreciated: "image": { "filename": "tumblr_2_250.gif", "value":"Content-Type: image/gif\r\n GIF89a�

ilanru avatar Feb 17 '23 13:02 ilanru

I would like formdata support too.

einar-hjortdal avatar Feb 15 '24 08:02 einar-hjortdal

@Coachonko you could continue the efforts of @ilanru if you'd like and I'll review the PR

v1rtl avatar Feb 15 '24 12:02 v1rtl

Well, sorry about the long delay, life got in the way.

I've drafted a small pr with the suggested changes: https://github.com/tinyhttp/milliparsec/pull/21

It was not very complex to extract the file fields, but I am not sure what is the proper response structure and how should the files be encoded as at the moment they are converted to simple strings inside the p function.

Here's an example response for files from the implementation, any suggestions would be appreciated: "image": { "filename": "tumblr_2_250.gif", "value":"Content-Type: image/gif\r\n GIF89a�

v1rtl avatar Feb 15 '24 12:02 v1rtl