Skip to content

Hurl debug curl command is erroneous with text request body that start with @ #5154

Description

@jcamiel

Given this Hurl file:

POST https://httpbin.io/anything
```
@filename
```

(post a text body @filename), the debug curl command produced by Hurl is erroneous:

$ hurl --verbose test.hurl
* ------------------------------------------------------------------------------
* Executing entry 1
*
...
* Request can be run with the following curl command:
* curl --header 'Content-Type:' --data $'@filename\n' 'https://httpbin.io/anything'
*
> POST /anything HTTP/1.1

Then running the curl command:

$ curl --header 'Content-Type:' --data $'@filename\n' 'https://httpbin.io/anything'
curl: Failed to open filename

curl: option --data: error encountered when reading a file
curl: try 'curl --help' or 'curl --manual' for more information

When producing curl command, we should:

  • use --data-raw for non binary body that doesn't start with an @
  • use --data-binary otherwise

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions