Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't do IO while preparing a Req (servant-client) ? #624

Closed
alpmestan opened this issue Oct 21, 2016 · 2 comments
Closed

Can't do IO while preparing a Req (servant-client) ? #624

alpmestan opened this issue Oct 21, 2016 · 2 comments

Comments

@alpmestan
Copy link
Contributor

Hi folks,

I've recently been working on servant-multipart, which provides form/multipart-data support to servant, mostly interesting for supporting file uploads.

While the server side of things required only a very minor change to Delayed to do things properly (#622), I got started thinking about client derivation. This should be possible in theory, given that http-client provides this module which does the hard work for us. However, adding multipart content to a request involves some IO: indeed, whenever you want to upload a local file, you have to go and read it to add its content to the request body.

As far as I can tell, this is not something we can do at the moment, and it would require us to "delay" the IO (a bit like we do in servant-server) until the point where the corresponding client function gets run. Or add a field that stores Parts in a list and simply fill that, instead of the request body field. This makes us have 2 fields for a single thing, that's not really satisfactory. That's why I'm opening this ticket -- I don't have any good idea to make this possible and reasonably nice. Does anyone? =)

Particularly interested in hearing @soenkehahn's thoughts.

@phadej
Copy link
Contributor

phadej commented Oct 21, 2016

I'm partly interested in it, as e.g. providing streaming (e.g. conduit based) is a similar issue.

@jkarni
Copy link
Member

jkarni commented Mar 6, 2018

This doesn't seem relevant anymore (both multipart and streaming work now, at least), so closing.

@jkarni jkarni closed this as completed Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants