Given this Hurl file:
POST http://localhost:8000/post-bytes-null
Content-Type: application/octet-stream
base64,AAECAw==; # printf '\x00\x01\x02\x03' | base64
HTTP 200
The request body sent is \x00\x01\x02\x03 but the curl command produced by Hurl (with --verbose or --curl) is:
$ curl --header 'Content-Type: application/octet-stream' --data $'\x00\x01\x02\x03' 'http://localhost:8000/post-bytes-null'
Because of the way of bash treats NUL-C terminated string, this does not work.
In this case (and only in this case), we could print the following curl command:
$ printf '\x00\x01\x02\x03' | curl --header 'Content-Type: application/octet-stream' --data-binary @- 'http://localhost:8000/post-bytes-null'
Given this Hurl file:
The request body sent is
\x00\x01\x02\x03but the curl command produced by Hurl (with--verboseor--curl) is:Because of the way of bash treats NUL-C terminated string, this does not work.
In this case (and only in this case), we could print the following curl command: