News for hackers. Stuff that matters.
Re:Show HN: Hurl – Run and test HTTP requests with plain tex... by fabricereix on Tuesday October 05, 2021 @09:34AM (#28759233)
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

There are no comments on this comment yet.