Live data from Hacker News

Python Requests: HTTP for Humans

python-requests.org

11–20 of 86 posts

Re: Python Requests: HTTP for Humans

#11

What's with the "for human beings" phrase? Is that a way of saying the software is easy?

"Requests is an ISC Licensed HTTP library, written in Python, for human beings.

Most existing Python modules for sending HTTP requests are extremely verbose and cumbersome. Python’s builtin urllib2 module provides most of the HTTP capabilities you should need, but the api is thoroughly broken. It requires an enormous amount of work (even method overrides) to perform the simplest of tasks."

Re: Python Requests: HTTP for Humans

#13

What's with the "for human beings" phrase? Is that a way of saying the software is easy?

It would appear so. Based off of testimonials and briefly looking at the API I'd say this is primarily aimed at a simple API + fewer "gotchas"

E.g., urllib/urllib2 both support urlopen(url, [data]) if `data` is supplied the request is executed as a POST, if not it is executed as a GET.

Issuing a GET w/ a querystring requires mutating the `url` and omitting `data`. This surprised me at first, and probably a number of others

Re: Python Requests: HTTP for Humans

#14
Absolutely my favourite recent development in the Python world. I won't be mistaken if I say that many of us have built half-arse versions of this on top of urllib(2) multiple times in the past. :-)

The support for keep-alive is particularly welcome, huge kudos to the author.

Question to users of other languages: do equivalents exist for PHP, Perl, C# or Java? Ruby folks rave about restclient, but is there anything else?

Re: Python Requests: HTTP for Humans

#15
post #9

Earlier quoted context omitted.

Keep-alive is 100% supported in the upcoming v0.7.0 release, along with async i/o :) Caching: I think that will be best be served by a hook/helper module, but we'll see.

Cool! Is there anything I can look at to see how async I/O will work? Does all the async support depend on gevent monkey patching (as requests/async.py would suggest)?

It's unreleased, and therefore completely undocumented at the moment. But here's the API: https://github.com/kennethreitz/requests/issues/98

Re: Python Requests: HTTP for Humans

#17

Absolutely my favourite recent development in the Python world. I won't be mistaken if I say that many of us have built half-arse versions of this on top of urllib(2) multiple times in the past. :-) The support for keep-alive is particularly welcome, huge kudos to the author. Question to users of other languages: do equivalents exist for PHP, Perl, C# or Java? Ruby folks rave about restclient, but is there anything e…

In the FAQ it says that support for keep-alive is on the way.

I do have a half-baked implementation on urllib2 that I hate. This is really cool.

Re: Python Requests: HTTP for Humans

#19

Absolutely my favourite recent development in the Python world. I won't be mistaken if I say that many of us have built half-arse versions of this on top of urllib(2) multiple times in the past. :-) The support for keep-alive is particularly welcome, huge kudos to the author. Question to users of other languages: do equivalents exist for PHP, Perl, C# or Java? Ruby folks rave about restclient, but is there anything e…

In the FAQ it says that support for keep-alive is on the way. I do have a half-baked implementation on urllib2 that I hate. This is really cool.

Keep-alive has first-class support in the soon-to-be-released version!

Re: Python Requests: HTTP for Humans

#20

Absolutely my favourite recent development in the Python world. I won't be mistaken if I say that many of us have built half-arse versions of this on top of urllib(2) multiple times in the past. :-) The support for keep-alive is particularly welcome, huge kudos to the author. Question to users of other languages: do equivalents exist for PHP, Perl, C# or Java? Ruby folks rave about restclient, but is there anything e…

For Ruby there's httparty, https://github.com/jnunemaker/httparty, curb, and a couple of others that escape me right now.
Post reply on HN