htty 1.5.1 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.markdown +5 -0
- data/README.markdown +1 -1
- data/examples.markdown +444 -0
- data/lib/htty/request.rb +1 -1
- data/lib/htty/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6b0501cdec3ac2c63cd4ce9ac168c62a10b97d3
|
4
|
+
data.tar.gz: 1c82ac93bea40439693db1e3f05ab9a76aba5d68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24b13680c6350e6aaf7b5d48056c16f7da966baf6e6d55621a97b0770b8979e29af6374fccc52eaf600e27813df6214cb38e1f6de5e857c21726e13b686a3c5d
|
7
|
+
data.tar.gz: 0747305f4c6c3829b834a7b2201843e059ccdb9eac8fd5cd7b148e473e0837de3cb7a4c67f3a428700e4b3f63e99b793c7e1cc602f8a3c6febf60ff12f12bb50
|
data/History.markdown
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
Version history for the _htty_ project
|
2
2
|
======================================
|
3
3
|
|
4
|
+
<a name="v1.5.3"></a>v1.5.3, Thu 9/17/2015
|
5
|
+
-------------------------------------------
|
6
|
+
|
7
|
+
* Fixed a bug that prevented the `http-patch` command from sending a request body
|
8
|
+
|
4
9
|
<a name="v1.5.1"></a>v1.5.1, Mon 9/14/2015
|
5
10
|
-------------------------------------------
|
6
11
|
|
data/README.markdown
CHANGED
@@ -69,7 +69,7 @@ The things you can do with _htty_ are:
|
|
69
69
|
Examples
|
70
70
|
========
|
71
71
|
|
72
|
-
Here are a few annotated _htty_ session transcripts to get you started.
|
72
|
+
Here are a few annotated _htty_ session transcripts to get you started (terminal screenshots shown here are also available in [textual form](http://github.com/htty/htty/blob/master/examples.markdown)).
|
73
73
|
|
74
74
|
Querying a web service
|
75
75
|
----------------------
|
data/examples.markdown
ADDED
@@ -0,0 +1,444 @@
|
|
1
|
+
# Examples
|
2
|
+
|
3
|
+
Here are a few annotated _htty_ session transcripts to get you started.
|
4
|
+
|
5
|
+
## Querying a web service
|
6
|
+
|
7
|
+
This simple example shows how to explore a read-only web service with _htty_.
|
8
|
+
|
9
|
+
### ESV Bible Web Service example #1
|
10
|
+
|
11
|
+
$ htty esvapi.org
|
12
|
+
*** Welcome to htty, the HTTP TTY. Heck To The Yeah!
|
13
|
+
http://esvapi.org/> get
|
14
|
+
*** Type fol[low] to follow the 'Location' header received in the response
|
15
|
+
301 Moved Permanently -- 6 headers -- 373-character body
|
16
|
+
http://esvapi.org/> follow
|
17
|
+
http://www.esvapi.org/>
|
18
|
+
|
19
|
+
You can point _htty_ at a complete or partial web URL. If you don’t supply a URL, http://0.0.0.0/ (port 80) will be used. You can vary the protocol scheme, userinfo, host, port, path, query string, and fragment as you wish.
|
20
|
+
|
21
|
+
The _htty_ shell prompt shows the address of the current request.
|
22
|
+
|
23
|
+
The `get` command is one of seven HTTP request methods supported. A concise summary of the response is shown when you issue a request.
|
24
|
+
|
25
|
+
You can follow redirects using the `follow` command. No request is made until you type a request command such as `get` or `post`.
|
26
|
+
|
27
|
+
### ESV Bible Web Service example #2
|
28
|
+
|
29
|
+
http://www.esvapi.org/> cd /v2/rest/nonexistent/path
|
30
|
+
http://www.esvapi.org/v2/rest/nonexistent/path> get
|
31
|
+
404 Not Found -- 5 headers -- 369-character body
|
32
|
+
http://www.esvapi.org/v2/rest/nonexistent/path> cd ../../passageQuery
|
33
|
+
http://www.esvapi.org/v2/rest/passageQuery>
|
34
|
+
|
35
|
+
You can tweak segments of the address at will. Here we are navigating the site’s path hierarchy, which you can do with relative as well as absolute pathspecs.
|
36
|
+
|
37
|
+
### ESV Bible Web Service example #3
|
38
|
+
|
39
|
+
http://www.esvapi.org/v2/rest/passageQuery> query-set key IP
|
40
|
+
http://www.esvapi.org/v2/rest/passageQuery?key=IP> query-set passage 'Luke 5:3-6'
|
41
|
+
http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=Luke%205:3-6> query-set output-format plain-text
|
42
|
+
http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=Luke%205:3-6&output-format=plain-text> get
|
43
|
+
200 OK -- 10 headers -- 565-character body
|
44
|
+
http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=Luke%205:3-6&output-format=plain-text> body
|
45
|
+
=======================================================
|
46
|
+
Luke 5:3-6
|
47
|
+
[3]Getting into one of the boats, which was Simon's, he asked him to
|
48
|
+
put out a little from the land. And he sat down and taught the people
|
49
|
+
from the boat. [4]And when he had finished speaking, he said to Simon,
|
50
|
+
"Put out into the deep and let down your nets for a catch." [5]And Simon
|
51
|
+
answered, "Master, we toiled all night and took nothing! But at your word
|
52
|
+
I will let down the nets." [6]And when they had done this, they enclosed
|
53
|
+
a large number of fish, and their nets were breaking. (ESV)
|
54
|
+
http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=Luke%205:3-6&output-format=plain-text>
|
55
|
+
|
56
|
+
Here we add query-string parameters. Notice that characters that require URL encoding are automatically URL-encoded (unless they are part of a URL-encoded expression).
|
57
|
+
|
58
|
+
The `headers-response` and `body-response` commands reveal the details of a response.
|
59
|
+
|
60
|
+
### ESV Bible Web Service example #4
|
61
|
+
|
62
|
+
http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=Luke%205:3-6&output-format=plain-text> address http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=Luke%205:3-6&output-format=plain-text&include-passage-horizontal-lines=false&include-passage-references=false&include-verse-numbers=false&include-short-copyright=false&line-length=0
|
63
|
+
http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=Luke%205:3-6&output-format=plain-text&include-passage-horizontal-lines=false&include-passage-references=false&include-verse-numbers=false&include-short-copyright=false&line-length=0> get
|
64
|
+
200 OK -- 9 headers -- 474-character body
|
65
|
+
http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=Luke%205:3-6&output-format=plain-text&include-passage-horizontal-lines=false&include-passage-references=false&include-verse-numbers=false&include-short-copyright=false&line-length=0> body
|
66
|
+
Getting into one of the boats, which was Simon's, he asked him to put out a little from the land. And he sat down and taught the people from the boat. And when he had finished speaking, he said to Simon, "Put out into the deep and let down your nets for a catch." And Simon answered, "Master, we toiled all night and took nothing! But at your word I will let down the nets." And when they had done this, they enclosed a large number of fish, and their nets were breaking.
|
67
|
+
http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=Luke%205:3-6&output-format=plain-text&include-passage-horizontal-lines=false&include-passage-references=false&include-verse-numbers=false&include-short-copyright=false&line-length=0> quit
|
68
|
+
*** Happy Trails To You!
|
69
|
+
$
|
70
|
+
|
71
|
+
There was some cruft in the web service’s response (a horizontal line, a passage reference, verse numbers, a copyright stamp, and line breaks). We eliminate it by using API options provided by the web service we’re talking to.
|
72
|
+
|
73
|
+
We do a Julia Child maneuver and use the `address` command to change the entire URL, rather than add individual query-string parameters one by one.
|
74
|
+
|
75
|
+
Exit your session at any time by typing `quit` or hitting Ctrl-D.
|
76
|
+
|
77
|
+
## Working with cookies
|
78
|
+
|
79
|
+
The next example demonstrates <i>htty</i>’s HTTP Secure support and cookies features, as well as how to review and revisit past requests.
|
80
|
+
|
81
|
+
### Google example #1
|
82
|
+
|
83
|
+
https://www.google.com/search?q=Ruby+programming+language> get
|
84
|
+
*** Type cookies-u[se] to use cookies offered in the response
|
85
|
+
*** Type fol[low] to follow the 'Location' header received in the response
|
86
|
+
302 Found -- 8 headers* -- 260-character body
|
87
|
+
https://www.google.com/search?q=Ruby+programming+language> headers-response
|
88
|
+
Location: https://encrypted.google.com/search?q=Ruby+programming+language
|
89
|
+
Cache-Control: private
|
90
|
+
Content-Type: text/html; charset=UTF-8
|
91
|
+
Set-Cookie:* O=HAI.; I=CAN; HAS=PRAIVASY?; G00G=RULZ!
|
92
|
+
Date: Tue, 28 Sep 2010 19:57:23 GMT
|
93
|
+
Server: gws
|
94
|
+
Content-Length: 260
|
95
|
+
X-Xss-Protection: 1; mode=block
|
96
|
+
https://www.google.com/search?q=Ruby+programming+language> follow
|
97
|
+
https://encrypted.google.com/search?q=Ruby+programming+language>
|
98
|
+
|
99
|
+
The _https://_ scheme and port 443 imply each other, just as the _http://_ scheme and port 80 imply each other. If you omit the scheme or the port, it will default to the appropriate value.
|
100
|
+
|
101
|
+
Notice that when cookies are offered in a response, a bold asterisk (it looks like a cookie) appears in the response summary. The same cookie symbol appears next to the _Set-Cookie_ header when you display response headers.
|
102
|
+
|
103
|
+
### Google example #2
|
104
|
+
|
105
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> headers-request
|
106
|
+
User-Agent: htty/1.1.0
|
107
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> cookies
|
108
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> cookies-use
|
109
|
+
*** 4 cookies now in use
|
110
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> headers-request
|
111
|
+
User-Agent: htty/1.1.0
|
112
|
+
Cookie:* O=HAI.; I=CAN; HAS=PRAIVASY?; G00G=RULZ!
|
113
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> cookies
|
114
|
+
O: HAI.
|
115
|
+
I: CAN
|
116
|
+
HAS: PRAIVASY?
|
117
|
+
G00G: RULZ!
|
118
|
+
https://encrypted.google.com/search?q=Ruby+programming+language>
|
119
|
+
|
120
|
+
The `cookies-use` command copies cookies out of the response into the next request. The cookie symbol appears next to the _Cookie_ header when you display request headers.
|
121
|
+
|
122
|
+
### Google example #3
|
123
|
+
|
124
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> get
|
125
|
+
200 OK -- 8 headers* -- 41111-character body
|
126
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> history
|
127
|
+
1 GET https://www.google.com/search?q=Ruby+programming+language -- 1 header -- empty body
|
128
|
+
302 Found -- 8 headers* -- 260-character body
|
129
|
+
2 GET https://www.google.com/search?q=Ruby+programming+language -- 2 headers* -- empty body
|
130
|
+
200 OK -- 8 headers* -- 41111-character body
|
131
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> headers-request
|
132
|
+
User-Agent: htty/1.1.0
|
133
|
+
Cookie:* O=HAI.; I=CAN; HAS=PRAIVASY?; G00G=RULZ!
|
134
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> reuse 1
|
135
|
+
*** Using a copy of request #1
|
136
|
+
https://encrypted.google.com/search?q=Ruby+programming+language> headers-request
|
137
|
+
User-Agent: htty/1.1.0
|
138
|
+
https://encrypted.google.com/search?q=Ruby+programming+language>
|
139
|
+
|
140
|
+
An abbreviated history is available through the `history` command. Information about requests in the history includes request method, URL, number of headers (and a cookie symbol, if cookies were sent), and the size of the body. Information about responses in the history includes response code, number of headers (and a cookie symbol, if cookies were received), and the size of the body.
|
141
|
+
|
142
|
+
Note that history contains only numbered HTTP request and response pairs, not a record of all the commands you enter.
|
143
|
+
|
144
|
+
The `reuse` command makes a copy of the headers and body of an earlier request for you to build on.
|
145
|
+
|
146
|
+
## Understanding complex HTTP conversations at a glance using history
|
147
|
+
|
148
|
+
Now we’ll look at <i>htty</i>’s HTTP Basic Authentication support and learn how to display unabbreviated transcripts of _htty_ sessions.
|
149
|
+
|
150
|
+
Assume that we have the following Sinatra application listening on Sinatra’s default port, 4567.
|
151
|
+
|
152
|
+
``` ruby
|
153
|
+
require 'sinatra'
|
154
|
+
|
155
|
+
get '/all-good' do
|
156
|
+
[200, [['Set-Cookie', 'foo=bar; baz']], 'Hello World!']
|
157
|
+
end
|
158
|
+
|
159
|
+
put '/huh' do
|
160
|
+
[404, 'What?']
|
161
|
+
end
|
162
|
+
|
163
|
+
delete '/hurl' do
|
164
|
+
[500, 'Barf!']
|
165
|
+
end
|
166
|
+
|
167
|
+
post '/submit-novel' do
|
168
|
+
redirect '/all-good'
|
169
|
+
end
|
170
|
+
```
|
171
|
+
|
172
|
+
This application expects _GET_ and _POST_ requests and responds in various contrived ways.
|
173
|
+
|
174
|
+
### Sinatra application example #1
|
175
|
+
|
176
|
+
http://0.0.0.0:4567/all-good> get
|
177
|
+
*** Type cookies-u[se] to use cookies offered in the response
|
178
|
+
200 OK -- 6 headers* -- 12-character body
|
179
|
+
http://0.0.0.0:4567/all-good> cookies-use
|
180
|
+
*** 2 cookies now in use
|
181
|
+
http://0.0.0.0:4567/all-good> cd /huh
|
182
|
+
http://0.0.0.0:4567/huh> put
|
183
|
+
404 Not Found -- 5 headers -- 5-character body
|
184
|
+
http://0.0.0.0:4567/huh> userinfo-set htty@nilsjonsson.com secret
|
185
|
+
http://htty%40nilsjonsson.com:secret@0.0.0.0:4567/huh> cd /hurl
|
186
|
+
http://htty%40nilsjonsson.com:secret@0.0.0.0:4567/hurl> delete
|
187
|
+
500 Internal Server Error -- 5 headers -- 5-character body
|
188
|
+
http://htty%40nilsjonsson.com:secret@0.0.0.0:4567/hurl> cookies-remove-all
|
189
|
+
http://htty%40nilsjonsson.com:secret@0.0.0.0:4567/hurl> userinfo-unset
|
190
|
+
http://0.0.0.0:4567/hurl> body-set
|
191
|
+
*** Enter two blank lines, or hit Ctrl-D, to signify the end of the body
|
192
|
+
If a body
|
193
|
+
|
194
|
+
meet a body
|
195
|
+
|
196
|
+
comin' through the rye
|
197
|
+
|
198
|
+
|
199
|
+
http://0.0.0.0:4567/hurl> header-set Author 'J. D. Salinger'
|
200
|
+
http://0.0.0.0:4567/hurl> cd /submit-novel
|
201
|
+
http://0.0.0.0:4567/submit-novel> post
|
202
|
+
*** Type fol[low] to follow the 'Location' header received in the response
|
203
|
+
302 Found -- 6 headers -- empty body
|
204
|
+
http://0.0.0.0:4567/submit-novel>
|
205
|
+
|
206
|
+
When you change the userinfo portion of the address, or the entire address, the appropriate HTTP Basic Authentication header is created for you automatically. Notice that characters that require URL encoding are automatically URL-encoded (unless they are part of a URL-encoded expression).
|
207
|
+
|
208
|
+
When userinfo is supplied in a request, a bold mercantile symbol ( _@_ ) appears next to the resulting _Authorization_ header when you display request headers (see below).
|
209
|
+
|
210
|
+
Type `body-set` to enter body data, and terminate it by entering two consecutive blank lines, or by hitting Ctrl-D. The body will only be sent for _POST_ and _PUT_ requests. The appropriate _Content-Length_ header is created for you automatically (see below).
|
211
|
+
|
212
|
+
Different response codes are rendered with colors that suggest their meaning:
|
213
|
+
|
214
|
+
* Response codes between 200 and 299 appear <span style="background-color: green; color: black; font-weight: bold; padding: 0 0.25em 0 0.25em;">black on green</span> to indicate success
|
215
|
+
* Response codes between 300 and 399 appear <span style="background-color: darkblue; color: white; font-weight: bold; padding: 0 0.25em 0 0.25em;">white on blue</span> to indicate redirection
|
216
|
+
* Response codes between 400 and 499 appear <span style="background-color: darkred; color: white; font-weight: bold; padding: 0 0.25em 0 0.25em;">white on red</span> to indicate failure
|
217
|
+
* Response codes between 500 and 599 appear <span style="background-color: yellow; color: black; font-weight: bold; padding: 0 0.25em 0 0.25em; text-decoration: blink;">flashing black on yellow</span> to indicate a server error
|
218
|
+
|
219
|
+
### Sinatra application example #2
|
220
|
+
|
221
|
+
http://0.0.0.0:4567/submit-novel> history-verbose
|
222
|
+
1 GET http://0.0.0.0:4567/all-good -- 1 header -- empty body
|
223
|
+
|
224
|
+
User-Agent: htty/1.1.0
|
225
|
+
|
226
|
+
200 OK -- 6 headers* -- 12-character body
|
227
|
+
|
228
|
+
Content-Type: text/html
|
229
|
+
Content-Length: 12
|
230
|
+
Server: WEBrick/1.3.1 (Ruby/1.9.3/2010-09-25)
|
231
|
+
Date: Tue, 28 Sep 2010 21:10:58 GMT
|
232
|
+
Connection: Keep-Alive
|
233
|
+
Set-Cookie:* foo=bar; baz
|
234
|
+
|
235
|
+
Hello World!
|
236
|
+
------------------------------------------------------------------------------
|
237
|
+
2 PUT http://0.0.0.0:4567/huh -- 3 headers* -- empty body
|
238
|
+
|
239
|
+
User-Agent: htty/1.1.0
|
240
|
+
Content-Length: 0
|
241
|
+
Cookie:* foo=bar; baz
|
242
|
+
|
243
|
+
404 Not Found -- 5 headers -- 5-character body
|
244
|
+
|
245
|
+
Content-Type: text/html
|
246
|
+
Content-Length: 5
|
247
|
+
Server: WEBrick/1.3.1 (Ruby/1.9.3/2010-09-25)
|
248
|
+
Date: Tue, 28 Sep 2010 21:11:05 GMT
|
249
|
+
Connection: Keep-Alive
|
250
|
+
|
251
|
+
What?
|
252
|
+
------------------------------------------------------------------------------
|
253
|
+
3 DELETE http://htty%40nilsjonsson.com:secret@0.0.0.0:4567/hurl -- 3 headers* -- empty body
|
254
|
+
|
255
|
+
User-Agent: htty/1.1.0
|
256
|
+
Cookie:* foo=bar; baz
|
257
|
+
Authorization:@ Basic aHR0eUBuaWxzam9uc3NvbjpzZWNyZXQ=
|
258
|
+
|
259
|
+
500 Internal Server Error -- 5 headers -- 5-character body
|
260
|
+
|
261
|
+
Content-Type: text/html
|
262
|
+
Content-Length: 5
|
263
|
+
Server: WEBrick/1.3.1 (Ruby/1.9.3/2010-09-25)
|
264
|
+
Date: Tue, 28 Sep 2010 21:12:17 GMT
|
265
|
+
Connection: Keep-Alive
|
266
|
+
|
267
|
+
Barf!
|
268
|
+
------------------------------------------------------------------------------
|
269
|
+
4 POST http://0.0.0.0:4567/submit-novel -- 3 headers -- 46-character body
|
270
|
+
|
271
|
+
User-Agent: htty/1.1.0
|
272
|
+
Content-Length: 46
|
273
|
+
Author: J. D. Salinger
|
274
|
+
|
275
|
+
If a body
|
276
|
+
|
277
|
+
meet a body
|
278
|
+
|
279
|
+
comin' through the rye
|
280
|
+
|
281
|
+
302 Found -- 6 headers -- empty body
|
282
|
+
|
283
|
+
Content-Type: text/html
|
284
|
+
Location: http://0.0.0.0:4567/all-good
|
285
|
+
Content-Length: 0
|
286
|
+
Server: WEBrick/1.3.1 (Ruby/1.9.3/2010-09-25)
|
287
|
+
Date: Tue, 28 Sep 2010 21:13:44 GMT
|
288
|
+
Connection: Keep-Alive
|
289
|
+
http://0.0.0.0:4567/submit-novel>
|
290
|
+
|
291
|
+
As with the abbreviated history demonstrated earlier, verbose history shows a numbered list of requests and the responses they elicited. All information exchanged between client and server is shown.
|
292
|
+
|
293
|
+
## Getting help
|
294
|
+
|
295
|
+
You can learn how to use _htty_ commands from within _htty_.
|
296
|
+
|
297
|
+
### <i>htty</i>’s built-in help
|
298
|
+
|
299
|
+
http://0.0.0.0/> help
|
300
|
+
|
301
|
+
Navigation
|
302
|
+
|
303
|
+
a[ddress] ADDRESS Changes the address of the
|
304
|
+
request
|
305
|
+
cd PATH Alias for path[-set]
|
306
|
+
fol[low] Changes the address of the
|
307
|
+
request to the value of the
|
308
|
+
response's 'Location' header
|
309
|
+
fragment-c[lear] Alias for
|
310
|
+
fragment-u[nset]
|
311
|
+
fragment-s[et] FRAGMENT Sets the fragment of the
|
312
|
+
request's address
|
313
|
+
fragment-u[nset] Removes the fragment from the
|
314
|
+
request's address
|
315
|
+
history Displays previous
|
316
|
+
request-response activity in
|
317
|
+
this session
|
318
|
+
history-[verbose] Displays the details of previous
|
319
|
+
request-response activity in
|
320
|
+
this session
|
321
|
+
ho[st-set] HOST Changes the host of the
|
322
|
+
request's address
|
323
|
+
path[-set] PATH Changes the path of the
|
324
|
+
request's address
|
325
|
+
por[t-set] PORT Changes the TCP port of the
|
326
|
+
request's address
|
327
|
+
query-a[dd] NAME [VALUE [NAME [VALUE ...]]] Adds query-string parameters to
|
328
|
+
the request's address
|
329
|
+
query-c[lear] Alias for
|
330
|
+
query-unset-[all]
|
331
|
+
query-r[emove] NAME [VALUE] Removes query-string parameters
|
332
|
+
from the end of the request's
|
333
|
+
address
|
334
|
+
query-s[et] NAME [VALUE [NAME [VALUE ...]]] Sets query-string parameters in
|
335
|
+
the request's address
|
336
|
+
query-unset NAME [VALUE] Removes query-string parameters
|
337
|
+
from the request's address
|
338
|
+
query-unset-[all] Clears the query string of the
|
339
|
+
request's address
|
340
|
+
r[euse] INDEX Copies a previous request by the
|
341
|
+
index number shown in history
|
342
|
+
sc[heme-set] SCHEME Changes the scheme (protocol
|
343
|
+
identifier) of the request's
|
344
|
+
address
|
345
|
+
userinfo-c[lear] Alias for
|
346
|
+
userinfo-u[nset]
|
347
|
+
userinfo-s[et] USERNAME [PASSWORD] Sets the userinfo of the
|
348
|
+
request's address
|
349
|
+
userinfo-u[nset] Removes the userinfo from the
|
350
|
+
request's address
|
351
|
+
|
352
|
+
Building Requests
|
353
|
+
|
354
|
+
body-c[lear] Alias for body-u[nset]
|
355
|
+
body-request Displays the body of the request
|
356
|
+
body-s[et] Sets the body of the request
|
357
|
+
body-u[nset] Clears the body of the request
|
358
|
+
cookie-a[dd] NAME [VALUE] Alias for cookies-a[dd]
|
359
|
+
cookie-r[emove] NAME Alias for cookies-remove
|
360
|
+
cookies Displays the cookies of the
|
361
|
+
request
|
362
|
+
cookies-a[dd] NAME [VALUE] Adds a cookie to the request
|
363
|
+
cookies-c[lear] Alias for
|
364
|
+
cookies-remove-[all]
|
365
|
+
cookies-remove NAME Removes from the request the
|
366
|
+
last cookie having a particular
|
367
|
+
name
|
368
|
+
cookies-remove-[all] Removes all cookies from the
|
369
|
+
request
|
370
|
+
cookies-u[se] Uses cookies offered in the
|
371
|
+
response
|
372
|
+
form (Help for form is not
|
373
|
+
available)
|
374
|
+
form-a[dd] (Help for form-a[dd] is
|
375
|
+
not available)
|
376
|
+
form-c[lear] Alias for
|
377
|
+
form-remove-[all]
|
378
|
+
form-remove (Help for form-remove is
|
379
|
+
not available)
|
380
|
+
form-remove-[all] (Help for
|
381
|
+
form-remove-[all] is not
|
382
|
+
available)
|
383
|
+
header-s[et] NAME VALUE Alias for headers-s[et]
|
384
|
+
header-u[nset] NAME Alias for headers-unset
|
385
|
+
headers-c[lear] Alias for
|
386
|
+
headers-unset-[all]
|
387
|
+
headers-req[uest] Displays the headers of the
|
388
|
+
request
|
389
|
+
headers-s[et] NAME VALUE Sets a header of the request
|
390
|
+
headers-unset NAME Removes a header of the request
|
391
|
+
headers-unset-[all] Removes all headers from the
|
392
|
+
request
|
393
|
+
|
394
|
+
Issuing Requests
|
395
|
+
|
396
|
+
d[elete] Alias for http-d[elete]
|
397
|
+
g[et] Alias for http-g[et]
|
398
|
+
http-d[elete] Issues an HTTP DELETE using the
|
399
|
+
current request
|
400
|
+
http-g[et] Issues an HTTP GET using the
|
401
|
+
current request
|
402
|
+
http-h[ead] Issues an HTTP HEAD using the
|
403
|
+
current request
|
404
|
+
http-o[ptions] Issues an HTTP OPTIONS using the
|
405
|
+
current request
|
406
|
+
http-po[st] Issues an HTTP POST using the
|
407
|
+
current request
|
408
|
+
http-pu[t] Issues an HTTP PUT using the
|
409
|
+
current request
|
410
|
+
http-t[race] Issues an HTTP TRACE using the
|
411
|
+
current request
|
412
|
+
pos[t] Alias for http-po[st]
|
413
|
+
pu[t] Alias for http-pu[t]
|
414
|
+
|
415
|
+
Inspecting Responses
|
416
|
+
|
417
|
+
body[-response] Displays the body of the
|
418
|
+
response
|
419
|
+
headers[-response] Displays the headers of the
|
420
|
+
response
|
421
|
+
st[atus] Displays the status of the
|
422
|
+
response
|
423
|
+
|
424
|
+
Preferences
|
425
|
+
|
426
|
+
ssl-verification Displays the preference for SSL
|
427
|
+
certificate verification
|
428
|
+
ssl-verification-of[f] Disables SSL certificate
|
429
|
+
verification
|
430
|
+
ssl-verification-on Reenables SSL certificate
|
431
|
+
verification
|
432
|
+
|
433
|
+
Miscellaneous
|
434
|
+
|
435
|
+
e[xit] Alias for qui[t]
|
436
|
+
hel[p] [COMMAND] Displays this help table, or
|
437
|
+
help on the specified command
|
438
|
+
qui[t] Quits htty
|
439
|
+
un[do] (Help for un[do] is not
|
440
|
+
available)
|
441
|
+
|
442
|
+
http://0.0.0.0/>
|
443
|
+
|
444
|
+
The `help` command takes an optional argument of the abbreviated or full name of a command.
|
data/lib/htty/request.rb
CHANGED
@@ -19,7 +19,7 @@ class HTTY::Request < HTTY::Payload
|
|
19
19
|
AUTHORIZATION_HEADER_NAME = 'Authorization'
|
20
20
|
COOKIES_HEADER_NAME = 'Cookie'
|
21
21
|
|
22
|
-
METHODS_SENDING_BODY = [:post, :put]
|
22
|
+
METHODS_SENDING_BODY = [:patch, :post, :put]
|
23
23
|
|
24
24
|
# Returns a URI authority (a combination of userinfo, host, and port)
|
25
25
|
# corresponding to the specified _components_ hash. Valid _components_ keys
|
data/lib/htty/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: htty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nils Jonsson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- README.markdown
|
76
76
|
- Rakefile
|
77
77
|
- bin/htty
|
78
|
+
- examples.markdown
|
78
79
|
- htty.gemspec
|
79
80
|
- lib/htty.rb
|
80
81
|
- lib/htty/cli.rb
|