Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL #3283

Open
2 tasks
jcampbell05 opened this issue Oct 4, 2024 · 3 comments
Open
2 tasks

REPL #3283

jcampbell05 opened this issue Oct 4, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@jcampbell05
Copy link

Problem to solve

It can be very annoying to have to make a temp file just to use HURL, this is one area in which curl is better. Ideally we could have a REPL where we can type a request and then hit enter twice to make it send that request.

Proposal

When typing hurl --repl we get a CLI interface that lets you write out your hurl file similar to python's repl, after hitting enter twice hurl will treat this as a signal to say the file is done.

After the request completes the repl should load back in the last request's hurl file so it can be adjusted.

Additional context and resources

Tasks to complete

  • Introduce repl interface
  • Documentation
@jcampbell05 jcampbell05 added the enhancement New feature or request label Oct 4, 2024
@fabricereix
Copy link
Collaborator

Hi @jcampbell05,
you can already use Hurl without creating a file by using the standard input.

$ echo GET https://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="https://www.google.com/">here</A>.
</BODY></HTML>
$ cat <<END | hurl --very-verbose
POST http://example.com
{ "message": "hello" }
END

A REPL could indeed be a nice feature, but to be honest, far from being priorized.

@jcamiel
Copy link
Collaborator

jcamiel commented Oct 9, 2024

I also find a REPL very attractive (maybe better at our current --interactive option which I doubt is used a lot). The thing that I'm a little worried is that a REPL would add a very different path code. So if there is a strong momentum on this issue / needs, why not.

@Jiehong
Copy link

Jiehong commented Nov 20, 2024

At least, it would be nice if perhaps hurl could try to read from stdin not only from a pipe (https://github.com/Orange-OpenSource/hurl/blob/master/packages/hurl_core/src/input.rs).

We could have this repl being the default when you just run hurl without any argument.

Or perhaps, if I run hurl 'GET https://www.wikipedia.org', hurl tries as a file just like today, and if the file does not exist, log it as a warning, and then tries to run the string as if it were a file content/stdin, and then fail at the end if it's not a valid format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants