http-request-translator icon indicating copy to clipboard operation
http-request-translator copied to clipboard

Interactive mode efficiency improvements

Open 7a opened this issue 8 years ago • 2 comments

I am not sure where the current approach came from, it would be much more useful to simply paste the whole HTTP request once and have the translator translate directly (i.e. in a single step: one paste x translation).

Instead, at present, the translator requires the user to enter the request in 2 steps: Step 1) Enter request headers (Ctrl+D to finish/Ctrl+C to quit). Step 2) Enter request body/parameters (Ctrl+D to finish/Ctrl+C to quit).

Given that HTTP requests have a known structure (2 newlines or \r\n\r\n between headers and body), it should be simple enough for the translator to let users paste the whole request once + figure out the rest from there, saving some time to the user ;)

7a avatar Apr 07 '16 00:04 7a

One more thing, I would point out , I can't understand the difference between stdin mode and interative mode. They are just same. I think interactive mode would be something like in which user can input more than one raw requests in a single session. If you think my idea is correct,let me know , I would like to work upon that.

rnehra01 avatar Oct 13 '16 06:10 rnehra01

@rnehra01 The stdin method allows you to do cat request.txt | hrt -s, while the interactive method is a user-friendly-let-me-tell-you-what-I-need-you-to-feed-me mode that is verbose.

@7a I agree that the interactive mode needs some rework. As of now, it only requires the user to enter the request and press ^D once he has entered it (no more 1. Headers and 2. Body). However, using \r\n\r\n as an end-of-request needle could prevent the user to actually input what he wants to input. Let's say that he wants to exploit the HTTP request splitting and that therefore, his request contains two HTTP requests. Using \r\n\r\n could prevent him from doing what he wants to to while ^D would not.

Thought?

DePierre avatar Jan 14 '17 17:01 DePierre