Skip to content

Commit f483c0b

Browse files
committed
Updated readme
1 parent 943e052 commit f483c0b

File tree

2 files changed

+89
-6
lines changed

2 files changed

+89
-6
lines changed

README.md

Lines changed: 88 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ Simple command line utility for tracing HTTP requests over redirects.
66
Usage: htrace [OPTIONS] URL
77
88
Options:
9-
-T, --timeout INTEGER Request timeout in seconds
10-
-a, --accept TEXT Accept header value
11-
-j, --json Report in JSON
12-
-b, --body Show response body
13-
--help Show this message and exit.
9+
-T, --timeout INTEGER Request timeout in seconds
10+
-a, --accept TEXT Accept header value
11+
-j, --json Report in JSON
12+
-b, --body Show response body
13+
-L, --link-type TEXT Follow link header with type
14+
-R, --link-rel TEXT Follow link header with rel
15+
-P, --link-profile TEXT Follow link header with profile
16+
--help Show this message and exit.
1417
```
1518

1619
Example:
@@ -53,3 +56,83 @@ Example:
5356
2021-03-19 08:18:09.457:SUMMARY: Num requests: 2
5457
2021-03-19 08:18:09.457:SUMMARY: Elapsed: 0.113 seconds
5558
```
59+
60+
Example following link header:
61+
```
62+
% htrace "http://schema.org/" -L "application/ld+json" -b | more
63+
2021-03-19 10:08:01.826:> GET: http://schema.org/
64+
2021-03-19 10:08:01.826:> Accept: */*
65+
2021-03-19 10:08:01.826:< 301 http://schema.org/
66+
2021-03-19 10:08:01.826:< Content-Length: 0
67+
2021-03-19 10:08:01.827:< Content-Type: text/html
68+
2021-03-19 10:08:01.827:< Date: Fri, 19 Mar 2021 14:08:01 GMT
69+
2021-03-19 10:08:01.827:< Location: https://schema.org/
70+
2021-03-19 10:08:01.827:< Server: Google Frontend
71+
2021-03-19 10:08:01.827:< X-Cloud-Trace-Context: fe909d0f5514086d3931cb6d1a64f764
72+
2021-03-19 10:08:01.827:< 0.0623 sec
73+
2021-03-19 10:08:01.892:> GET: https://schema.org/
74+
2021-03-19 10:08:01.892:> Accept: */*
75+
2021-03-19 10:08:01.892:< 200 https://schema.org/
76+
2021-03-19 10:08:01.892:< Access-Control-Allow-Credentials: true
77+
2021-03-19 10:08:01.892:< Access-Control-Allow-Headers: Accept
78+
2021-03-19 10:08:01.892:< Access-Control-Allow-Methods: GET
79+
2021-03-19 10:08:01.892:< Access-Control-Allow-Origin: *
80+
2021-03-19 10:08:01.893:< Access-Control-Expose-Headers: Link
81+
2021-03-19 10:08:01.893:< Age: 229
82+
2021-03-19 10:08:01.893:< Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
83+
2021-03-19 10:08:01.893:< Cache-Control: public, max-age=600
84+
2021-03-19 10:08:01.893:< Content-Encoding: gzip
85+
2021-03-19 10:08:01.893:< Content-Length: 2206
86+
2021-03-19 10:08:01.893:< Content-Type: text/html
87+
2021-03-19 10:08:01.893:< Date: Fri, 19 Mar 2021 14:04:12 GMT
88+
2021-03-19 10:08:01.893:< ETag: "z2afww"
89+
2021-03-19 10:08:01.893:< Expires: Fri, 19 Mar 2021 14:14:12 GMT
90+
2021-03-19 10:08:01.893:< Link: </docs/jsonldcontext.jsonld>; rel="alternate"; type="application/ld+json"
91+
2021-03-19 10:08:01.893:< Server: Google Frontend
92+
2021-03-19 10:08:01.893:< X-Cloud-Trace-Context: 72fe99328f0f0e7869ce616b1efc6e64;o=3
93+
2021-03-19 10:08:01.893:< 0.0619 sec
94+
2021-03-19 10:08:01.894:L Follow Link: https://schema.org/docs/jsonldcontext.jsonld
95+
2021-03-19 10:08:01.914:> GET: https://schema.org/docs/jsonldcontext.jsonld
96+
2021-03-19 10:08:01.914:> Accept: */*
97+
2021-03-19 10:08:01.914:< 200 https://schema.org/docs/jsonldcontext.jsonld
98+
2021-03-19 10:08:01.915:< Access-Control-Allow-Credentials: true
99+
2021-03-19 10:08:01.915:< Access-Control-Allow-Headers: Accept
100+
2021-03-19 10:08:01.915:< Access-Control-Allow-Methods: GET
101+
2021-03-19 10:08:01.915:< Access-Control-Allow-Origin: *
102+
2021-03-19 10:08:01.915:< Age: 450
103+
2021-03-19 10:08:01.915:< Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
104+
2021-03-19 10:08:01.915:< Cache-Control: public, max-age=600
105+
2021-03-19 10:08:01.915:< Content-Length: 163023
106+
2021-03-19 10:08:01.915:< Content-Type: application/ld+json
107+
2021-03-19 10:08:01.915:< Date: Fri, 19 Mar 2021 14:00:31 GMT
108+
2021-03-19 10:08:01.915:< ETag: "z2afww"
109+
2021-03-19 10:08:01.915:< Expires: Fri, 19 Mar 2021 14:10:31 GMT
110+
2021-03-19 10:08:01.915:< Server: Google Frontend
111+
2021-03-19 10:08:01.915:< X-Cloud-Trace-Context: eceac0df35d0f09e46ebe05068460ef7;o=1
112+
2021-03-19 10:08:01.915:< 0.0154 sec
113+
2021-03-19 10:08:01.915:L Match linked type application/ld+json
114+
2021-03-19 10:08:01.986:SUMMARY: Start URL: http://schema.org/
115+
2021-03-19 10:08:01.986:SUMMARY: Final URL: https://schema.org/docs/jsonldcontext.jsonld
116+
2021-03-19 10:08:01.986:SUMMARY: Start: 2021-03-19T14:08:01+0000
117+
2021-03-19 10:08:01.986:SUMMARY: Num requests: 3
118+
2021-03-19 10:08:01.986:SUMMARY: Elapsed: 0.140 seconds
119+
{
120+
"@context": {
121+
"type": "@type",
122+
"id": "@id",
123+
"HTML": { "@id": "rdf:HTML" },
124+
125+
"@vocab": "http://schema.org/",
126+
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
127+
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
128+
"xsd": "http://www.w3.org/2001/XMLSchema#",
129+
"schema": "http://schema.org/",
130+
"owl": "http://www.w3.org/2002/07/owl#",
131+
"dc": "http://purl.org/dc/elements/1.1/",
132+
"dct": "http://purl.org/dc/terms/",
133+
"dctype": "http://purl.org/dc/dcmitype/",
134+
"void": "http://rdfs.org/ns/void#",
135+
"dcat": "http://www.w3.org/ns/dcat#",
136+
"3DModel": {"@id": "schema:3DModel"},
137+
...
138+
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "htrace"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "Tracing HTTP requests over redirects, link headers"
55
authors = ["datadavev <[email protected]>"]
66
license = "Apache 2.0"

0 commit comments

Comments
 (0)