Skip to content

Commit 9665f96

Browse files
authored
Merge pull request #52 from git001/patch-1
Add example for X-Request-ID
2 parents 10c581b + ecc1829 commit 9665f96

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

website/content/middleware/request-id.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,17 @@ DefaultRequestIDConfig = RequestIDConfig{
4545
Generator: generator,
4646
}
4747
```
48+
49+
## Set ID
50+
51+
You can set the id from the requester with the `X-Request-ID`-Header
52+
53+
*request*
54+
```
55+
curl -H "X-Request-ID: 3" --compressed -v "http://localhost:1323/?my=param"
56+
```
57+
58+
*Log*
59+
```
60+
{"time":"2017-11-13T20:26:28.6438003+01:00","id":"3","remote_ip":"::1","host":"localhost:1323","method":"GET","uri":"/?my=param","my":"param","status":200, "latency":0,"latency_human":"0s","bytes_in":0,"bytes_out":13}
61+
```

0 commit comments

Comments
 (0)