Skip to content

feat(client): add a new Client struct with super powers #182

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

Merged
merged 1 commit into from
Dec 14, 2014
Merged

Conversation

seanmonstar
Copy link
Member

  • Includes ergonomic traits like IntoUrl and IntoBody, allowing easy
    usage.
  • Client can have a RedirectPolicy.
  • Client can have a SslVerifier.

Updated benchmarks for client. (Disabled rust-http client bench since it
hangs.)

Closes #62

@@ -64,22 +60,20 @@ fn main() {
[Client Bench:](./benches/client.rs)

```

running 3 tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be "running 2 tests"?

@Manishearth
Copy link
Contributor

❤️ the design :)

I'm not entirely certain if it does this already, but if not in the future we might want to be able to have Client persist cookies, similar to Python's requests.session.

req.start().unwrap()
.send().unwrap()
.read_to_string().unwrap()
client.request(RequestOptions {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of building this RequestOptions struct, which will break if we add fields in the future, I think it would be best if client.request() returned a builder type, that way we can add more options without breaking existing code.

@seanmonstar
Copy link
Member Author

@reem updated

@reem
Copy link
Contributor

reem commented Dec 12, 2014

Can we move the method and url arguments to client.request() so that you can just do client.request(Get, url) and then chain directly off of that, rather than requiring an explicit RequestBuilder::new, since that's a lot of characters.

@seanmonstar
Copy link
Member Author

Yep, that's exactly what I was working on right now.

@seanmonstar
Copy link
Member Author

@reem like that?

@reem
Copy link
Contributor

reem commented Dec 12, 2014

Yup, looks great. Rebase?

@seanmonstar seanmonstar force-pushed the client branch 3 times, most recently from 0c9755b to dfa3431 Compare December 14, 2014 19:10
- Includes ergonomic traits like IntoUrl and IntoBody, allowing easy
usage.
- Client can have a RedirectPolicy.
- Client can have a SslVerifier.

Updated benchmarks for client. (Disabled rust-http client bench since it
hangs.)
@seanmonstar
Copy link
Member Author

finally green!

seanmonstar added a commit that referenced this pull request Dec 14, 2014
feat(client): add a new Client struct with super powers
@seanmonstar seanmonstar merged commit d19cfed into master Dec 14, 2014
@seanmonstar seanmonstar deleted the client branch December 14, 2014 20:02
@Manishearth
Copy link
Contributor

\o/

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

Successfully merging this pull request may close these issues.

Helper function http_get
3 participants