Investigate setting Content-Type header based on Requestable type
garyb opened this issue · 2 comments
garyb commented
Mainly just need to figure out how to deal with boundaries for multipart/form-data.
garyb commented
I think to make this work we'll have to go with:
class Requestable a where
requestType :: a -> MimeType
toRequest :: a -> RequestContentThat way requestType can use information about the content to construct things like the form data boundaries, charset, etc. Originally I had intended to use Proxy a as the requestType input, but I guess we don't need the Proxy in there, as unlike with Responsable we will actually have an a value at request time.
jdegoes commented
Maybe you could do something like:
class Requestable a where
toRequest :: a -> Tuple a RequestContentJust to clean it up a bit?