htty/htty — pull request #112 by gabrielelana (2014-02-21 14:14:07+00:00)
Title: Issue 91

Fixes #91

It's not exactly what #91 asked but it's definitely an improvement of the scripting support. Now it will read commands from `STDIN` without using the readline library and it will correctly terminate ad the end of the input. I didn't remove the prompt because I think the output with prompts (aka request uri) and commands (aka what you are going to do) it's more clear

```
$ cat < address 0.0.0.0:3333
pipe heredoc> get
pipe heredoc> headers
pipe heredoc> follow
pipe heredoc> get
pipe heredoc> body
pipe heredoc> COMMANDS
*** Welcome to htty , the HTTP TTY. Heck To The Yeah!
http://0.0.0.0/> address 0.0.0.0:3333
http://0.0.0.0:3333/> get
*** Type fol[low] to follow the 'Location' header received in the response
200 OK -- 5 headers -- 6-character body
http://0.0.0.0:3333/> headers
Date: Fri, 21 Feb 2014 14:02:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked
Location: found
Link: http://example.com/foo, http://example.com/bar
http://0.0.0.0:3333/> follow
http://0.0.0.0:3333/found> get
200 OK -- 5 headers -- 6-character body
http://0.0.0.0:3333/found> body
Yay!!!
*** Happy Trails To You!
```
Otherwise, without prompt/commands we will have something like
```
cat < address 0.0.0.0:3333
pipe heredoc> get
pipe heredoc> headers
pipe heredoc> follow
pipe heredoc> get
pipe heredoc> body
pipe heredoc> COMMANDS
*** Welcome to htty , the HTTP TTY. Heck To The Yeah!
*** Type fol[low] to follow the 'Location' header received in the response
200 OK -- 5 headers -- 6-character body
Date: Fri, 21 Feb 2014 14:09:25 GMT
Connection: keep-alive
Link: http://example.com/foo, http://example.com/bar
Transfer-Encoding: chunked
Location: found
200 OK -- 5 headers -- 6-character body
Yay!!!
*** Happy Trails To You!
```
I don't think this is what we want, I'm I right @njonsson?