mirror of
https://github.com/actix/actix-extras.git
synced 2025-02-23 19:03:03 +01:00
26 lines
427 B
Markdown
26 lines
427 B
Markdown
|
# Request ID in Response Header
|
||
|
|
||
|
This example shows how to set the `RequestId` as a response header.
|
||
|
|
||
|
## Running
|
||
|
|
||
|
You can launch this example with
|
||
|
|
||
|
```bash
|
||
|
cargo run
|
||
|
```
|
||
|
|
||
|
An `actix-web` application will be listening on port `8080`.
|
||
|
You can fire requests to it with:
|
||
|
|
||
|
```bash
|
||
|
curl -v http://localhost:8080/hello
|
||
|
```
|
||
|
```text
|
||
|
...
|
||
|
< HTTP/1.1 200 OK
|
||
|
< content-length: 12
|
||
|
< x-request-id: 1d5c5448-44d2-4051-ab59-985868875f94
|
||
|
...
|
||
|
```
|