Better HN
topnewbestaskshowjobs
Log inSign up

fabricereix

10 karma · joined Nov 24, 2020 (6y ago) · 6 submissions

Submissions

comment 5y ago · link · parent

Yes you can.

    $ echo GET http://google.com | hurl
    <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
    <TITLE>301 Moved</TITLE></HEAD><BODY>
    <H1>301 Moved</H1>
    The document has moved
    <A HREF="http://www.google.com/">here</A>.
    </BODY></HTML>

comment 5y ago · link · parent

This is not possible yet.

We have related issues: - https://github.com/Orange-OpenSource/hurl/issues/87 - https://github.com/Orange-OpenSource/hurl/issues/88

Running several Hurl files concurrently (and independently) is clear and we will probably add in the next few months.

Running requests concurrently in the same Hurl file will be more complicated. The Hurl language has to describe a clear semantic about it.

comment 5y ago · link · parent

You don't need a Rust compiler as prebuilt binaries are available for your system. https://hurl.dev/docs/installation.html

Relating to the choice of Rust, we think that it is the best language for this type of command-line tool. Performant like C/C++, but way safer to develop. And using native existing libs such as libcurl is possible.

comment 5y ago · link · parent

Yes, this is possible to chain a value from a response to the next request. The value is extracted and stored in a variable. This variable can be reused afterward.

    # Get home:
    GET https://example.net
    
    HTTP/1.1 200
    [Captures]
    csrf_token: xpath "string(//meta[@name='_csrf_token']/@content)"
    
    # Do login!
    POST https://example.net/login?user=toto&password=1234
    X-CSRF-TOKEN: {{csrf_token}}
    
    HTTP/1.1 302

comment 5y ago · link · parent

We are planning the possibility to stop between requests with an inspection mode. We would also love an ncurse interface, like mitmproxy.

comment 5y ago · link · parent

We have the option to include a body from an external file, this is especially useful for large or binary payload.

  POST https://example.net
  file,data.bin;