Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Improve client's API #9

Open
flaper87 opened this issue Sep 6, 2013 · 5 comments
Open

Improve client's API #9

flaper87 opened this issue Sep 6, 2013 · 5 comments

Comments

@flaper87
Copy link

flaper87 commented Sep 6, 2013

The idea is to implement an API along the lines of python-requests.

@chris-morgan
Copy link
Owner

Note that this should be an addition, sitting on top of what is currently there (though that too will doubtless be changed around quite a bit).

I'm not certain where things like redirect handling belong; a couple of designs for that that occur to me are:

  • Add functions which take a response and advise on what should be done about it with an enum (this is not necessarily incompatible with other approaches);
  • Add another layer which takes care of these things;
  • Put this into the current client layer with flags to disable them;
  • Have this solely in the "friendly" layer.

@flaper87
Copy link
Author

flaper87 commented Sep 6, 2013

I agree.

The plan is to add a separate module, which defines the API that will sit on top of the current implementation. It'll be implemented as a nice abstraction of the lower level parts of the client.

As for now, I think this should be implemented as plain functions defined within the api.rs module. Later on, a session trait could be added, synchronous support - I'm not sure whether this belongs here - and support for other things.

I'll start working on a first example and that we can brainstorm on.

flaper87 added a commit to flaper87/rust-http that referenced this issue Sep 6, 2013
@flaper87
Copy link
Author

flaper87 commented Sep 6, 2013

I won't make any pull request until it's done. I mentioned the issue in the commit for the sake of the discussion happening here.

flaper87 added a commit to flaper87/rust-http that referenced this issue Sep 8, 2013
flaper87 added a commit to flaper87/rust-http that referenced this issue Sep 14, 2013
flaper87 added a commit to flaper87/rust-http that referenced this issue Oct 5, 2013
flaper87 added a commit to flaper87/rust-http that referenced this issue Oct 5, 2013
flaper87 added a commit to flaper87/rust-http that referenced this issue Oct 5, 2013
flaper87 added a commit to flaper87/rust-http that referenced this issue Dec 1, 2013
@flaper87
Copy link
Author

@chris-morgan ping?

@chris-morgan
Copy link
Owner

(See #23 (comment).)

metajack added a commit to metajack/rust-http that referenced this issue Aug 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants