Detailed examples
@@ -72,7 +82,7 @@ There are multiple ways to attach headers to a response:
```
-- The following example shows how Headers could be added to `Response` in the `Middleware` implementation:
+- The following example shows how Headers could be added to `Response` in the `Middleware` implementation:
```scala
@@ -96,15 +106,6 @@ There are multiple ways to attach headers to a response:
-### Reading Headers from `Request`
-
-On the Server-side you can read Request headers as given below
-
-```scala
- case req @ Method.GET -> !! / "streamOrNot" =>
- req.getHeaders
-```
-
## Client-Side
### Adding headers to `Request`
@@ -116,6 +117,12 @@ val headers = Headers.host("sports.api.decathlon.com").withAccept(HeaderValues.a
val response = Client.request(url, headers)
```
+### Reading headers from `Response`
+
+```scala
+val responseHeaders: Task[Headers] = Client.request(url).map(_.headers)
+```
+