Re:Show HN: HTTPLang – a scripting language for making HTTP ...
by harel on Monday May 25, 2015 @06:12AM
(#9599368)
Just a side note, you pushed pyc files into the repo. .gitignore would be useful there.
Otherwise, I don't really see what's wrong or "hard" with requests and how is that better, could you elaborate on that point?
The only complicated things I see above are in the HTTPLang version: a variable called "URL" that isn't actually the URL that is being requested, and I guessed at how the cookie functionality worked because it's not at all obvious – I'm assuming that `set COOKIE $TMPCOOKIE` gets the cookie from the previous request and sets it for the subsequent requests.
> I find the process to be stupidly complicated, and handling cookies is a nightmare.
However this is about as straightforward as it can get with Requests. This is the HTTPLang example:
Here is the equivalent in Python using Requests: Where's the stupidly complicated nightmare?The only complicated things I see above are in the HTTPLang version: a variable called "URL" that isn't actually the URL that is being requested, and I guessed at how the cookie functionality worked because it's not at all obvious – I'm assuming that `set COOKIE $TMPCOOKIE` gets the cookie from the previous request and sets it for the subsequent requests.
https://github.com/jmcarp/robobrowser