#Sending multipart/form-data http request

1 messages · Page 1 of 1 (latest)

tulip raft
#

(I'm new to Gleam) I'm working on a library that needs to create a HTTP request with multipart/form-data body. I've read https://hexdocs.pm/gleam_http/gleam/http/request.html and tried searching but didn't find anything.

I also found this in the #general channel where @fair trout said it doesn't exist yet but that was Jan 2024 so I'm wondering if things have changed since. https://discordapp.com/channels/768594524158427167/768594524158427170/1201598832362926142

I appreciate any help.

fair trout
#

I don't believe anyone has written a multipart form encoder

#

It's not a very complex format though, you should have no trouble making it

#

It's mostly just joining thing with a random string and \r\n

tulip raft
#

Got it, I will look into writing my own. Thank you.

fair trout
#

no problem!

tulip raft
#

I was able to get this to work 🙂 although it currently only works for plain text and not files