hurl
hurl copied to clipboard
Create a Hurl Entry from a Curl?
(Imported from original discussion @leeola)
To rapidly create tests it would be helpful to be able to create Hurl Entries from a Curl command directly. Eg allowing a workflow of going through a browser application and copying the API requests via Copy as cURL
and importing that directly into Hurl.
Is that possible now?
That would be very useful, indeed. For a first step, we could provide Python scripts to make that conversion between curl commands and Hurl.
There is also the conversion between HAR and Hurl.
@fabricereix Is there any progress in this function now? I also think this function can make curl
users better use it
not really I'll try to start a script in the next few days
We could add this convertion in hurlfmt
.
Currently, hurlfmt
takes only an Hurl input
and the output format is specified with --format text(default), json or html
We could also specify the input format.
for example
cat sample.curl | hurlfmt --in curl --out hurl > sample.hurl
--in Specify input format hurl (default), curl or har
--out Specify output format hurl (default), json or html
The --format
option will therefore be replaced by --out
.
We could even add more combinations in the future, for example, for Hurl to curl.
We could add this convertion in
hurlfmt
.Currently,
hurlfmt
takes only an Hurl input and the output format is specified with--format text(default), json or html
We could also specify the input format.
for example
cat sample.curl | hurlfmt --in curl --out hurl > sample.hurl --in Specify input format hurl (default), curl or har --out Specify output format hurl (default), json or html
The
--format
option will therefore be replaced by--out
. We could even add more combinations in the future, for example, for Hurl to curl.
Thank you very much I personally look forward to this feature
Hi @zorohu,
the option --in curl
has been added in hurlfmt in master.
It's still beta, it supports only a few curl options.
I would be interested to get your feedback before releasing a new version.
But you will need need rust installed and run cargo build
.
hurlfmt is built by default in target/debug
.
Ping @leeola (original discussion creator)