Closed talentlessguy closed 1 month ago
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 easiest solution is just being able to parse text fields. if files are doable without introducing new dependencies, even better.
Oh that was quick
Alright, I'll start with text fields and go from there, thanks
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� � �� ��D2#$" }
I would like formdata support too.
@Coachonko you could continue the efforts of @ilanru if you'd like and I'll review the PR
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� � �� ��D2#$" }
Just encode the value to Uint8Array
form data is not supported, it wraps files into a File
, which should take care of encoding
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 itrelated: #4