Skip to content

How to inject formdata (or files in general) #4479

Closed Answered by metcoder95
tombrouwer asked this question in Q&A
Discussion options

You must be logged in to vote

The behavior is correct and intended, as by the spec RFC2046, the boundary property is mandatory. It is an arbitrary value added upon dispatch of a given request and should be attached at the end of the MIME of the multipart/form-data content type header.

It indicates the boundary or end of a Request's body. For instance, it is required to allow the server to understand where the stream's body ends.

Now, why it works in insomnia? It is because insomnia does this calculation and handling for you; meanwhile, light-my-request (the engine behind Fastify#inject) does not do this calculation nor handling of the boundary delimiter.

As @leandroandrade suggested, the usage of the given library han…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Fdawgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants