

Show HN: HTTPLang – a scripting language for making HTTP requests - max0563
https://github.com/Max00355/HTTPLang

======
harel
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?

~~~
JimDabell
I thought the same thing. The README says:

> 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:

    
    
        set URL http://somesite.com
        set POSTDATA username=myUsername,password=myPassword is this
        do POST /login
        set COOKIE $TMPCOOKIE
        do GET /usercp
    

Here is the equivalent in Python using Requests:

    
    
        import requests
    
        url = "http://example.com"
        post_data = { "username": "myUsername", "password": "myPassword is this" }
        response = requests.post(url + "/login", data=post_data)
        cookies = response.cookies
        requests.get(url + "/usercp", cookies=cookies)
    

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.

~~~
harel
Not to mention curl is also already very simple.

~~~
lgas
Or
[https://github.com/jakubroztocil/httpie](https://github.com/jakubroztocil/httpie).

------
joined
I don't see the improvement over something like HTTPie
([https://github.com/jakubroztocil/httpie](https://github.com/jakubroztocil/httpie)).

------
santiagobasulto
I like DSLs. Good work. Of course, there will be a lot of things to improve,
but kudos on the idea and the execution.

------
avinassh
OP, have you looked into Robo Browser? I think it does same thing as your
project

[https://github.com/jmcarp/robobrowser](https://github.com/jmcarp/robobrowser)

