Live data from Hacker News

Python Requests: HTTP for Humans

python-requests.org

21–30 of 86 posts

Re: Python Requests: HTTP for Humans

#22
post #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.

Here's the new one I'm working on:

https://github.com/tarcieri/http

httparty does a few of the same tricks, but I still find its API a bit obtrusive. At least it automatically parses JSON! (my library does this too, if an appropriate library is loaded)

In addition to a humane interface, it will soon be backed by a Ragel-generated HTTP parser:

https://github.com/tarcieri/http/tree/master/parser

Re: Python Requests: HTTP for Humans

#24

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…

C# / .NET had System.Net.WebRequest since 1.1. It's similar in principle to Requests.

Re: Python Requests: HTTP for Humans

#30

Looks like Python got something similar to Perl's LWP https://metacpan.org/module/LWP

I think LWP is more equivalent to Python's urllib2 (ie. both big beasts!). So this i believe is closer to what LWP::UserAgent (https://metacpan.org/module/LWP::UserAgent) does.

Also check out Mojo::UserAgent (https://metacpan.org/module/Mojo::UserAgent) for a nice(er) alternative. And don't forget that Perl now comes a nice lightweight alternative as standard: https://metacpan.org/module/HTTP::Tiny

Post reply on HN