File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## v0.5.10 (2025-03-21)
4+
5+ * [ ` Req ` ] : Add ` Req.get_headers_list/1 ` .
6+
37## v0.5.9 (2025-03-17)
48
59 * [ ` encode_body ` ] : Support any enumerable in ` :form_multipart `
@@ -1204,6 +1208,7 @@ See "Adapter" section in `Req.Request` module documentation for more information
12041208[ `Req.merge/2` ] : https://hexdocs.pm/req/Req.html#merge/2
12051209[ `Req.parse_message/2` ] : https://hexdocs.pm/req/Req.html#merge/2
12061210[ `Req.cancel_async_request/1` ] : https://hexdocs.pm/req/Req.html#merge/2
1211+ [ `Req.get_headers_list/1` ] : https://hexdocs.pm/req/Req.html#get_headers_list/1
12071212
12081213[ `Req.Request` ] : https://hexdocs.pm/req/Req.Request.html
12091214[ `Req.Request.new/1` ] : https://hexdocs.pm/req/Req.Request.html#new/1
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ defmodule Req do
101101
102102 See `:into` option in `Req.new/1` documentation for more information on response body streaming.
103103
104- ## Header Names
104+ ## Headers
105105
106106 The HTTP specification requires that header names should be case-insensitive.
107107 Req allows two ways to access the headers; using functions and by accessing
@@ -121,6 +121,17 @@ defmodule Req do
121121 * functions like `Req.Request.get_header/2`, `Req.Request.put_header/3`,
122122 `Req.Response.get_header/2`, `Req.Response.put_header/3`, etc
123123 automatically downcase the given header name.
124+
125+ > #### Note {: .tip}
126+ >
127+ > Most Elixir/Erlang HTTP clients represent headers as lists of tuples like:
128+ >
129+ > ```elixir
130+ > [{"content-type", "text/plain"}]`
131+ > ```
132+ >
133+ > For interopability with those, use
134+ > `Req.get_headers_list/1`.
124135 """
125136
126137 # Response streaming to caller:
@@ -177,7 +188,7 @@ defmodule Req do
177188
178189 If you set `:headers` options both in `Req.new/1` and `request/2`, the header lists are merged.
179190
180- See also "Header Names " section in the module documentation.
191+ See also "Headers " section in the module documentation.
181192
182193 * `:body` - the request body.
183194
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ defmodule Req.Request do
6363 * `:url` - the HTTP request URL.
6464
6565 * `:headers` - the HTTP request headers. The header names should be downcased.
66- See also "Header Names " section in `Req` module documentation.
66+ See also "Headers " section in `Req` module documentation.
6767
6868 * `:body` - the HTTP request body.
6969
@@ -854,7 +854,7 @@ defmodule Req.Request do
854854 @ doc """
855855 Returns the values of the header specified by `name`.
856856
857- See also "Header Names " section in `Req` module documentation.
857+ See also "Headers " section in `Req` module documentation.
858858
859859 ## Examples
860860
@@ -877,7 +877,7 @@ defmodule Req.Request do
877877
878878 If the header was previously set, its value is overwritten.
879879
880- See also "Header Names " section in `Req` module documentation.
880+ See also "Headers " section in `Req` module documentation.
881881
882882 ## Examples
883883
@@ -941,7 +941,7 @@ defmodule Req.Request do
941941
942942 All occurrences of the header are deleted, in case the header is repeated multiple times.
943943
944- See also "Header Names " section in `Req` module documentation.
944+ See also "Headers " section in `Req` module documentation.
945945
946946 ## Examples
947947
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ defmodule Req.Response do
77 * `:status` - the HTTP status code.
88
99 * `:headers` - the HTTP response headers. The header names should be downcased.
10- See also "Header Names " section in `Req` module documentation.
10+ See also "Headers " section in `Req` module documentation.
1111
1212 * `:body` - the HTTP response body.
1313
@@ -150,7 +150,7 @@ defmodule Req.Response do
150150 @ doc """
151151 Returns the values of the header specified by `name`.
152152
153- See also "Header Names " section in `Req` module documentation.
153+ See also "Headers " section in `Req` module documentation.
154154
155155 ## Examples
156156
@@ -166,7 +166,7 @@ defmodule Req.Response do
166166 Adds a new response header `name` if not present, otherwise replaces the
167167 previous value of that header with `value`.
168168
169- See also "Header Names " section in `Req` module documentation.
169+ See also "Headers " section in `Req` module documentation.
170170
171171 ## Examples
172172
@@ -184,7 +184,7 @@ defmodule Req.Response do
184184
185185 All occurrences of the header are deleted, in case the header is repeated multiple times.
186186
187- See also "Header Names " section in `Req` module documentation.
187+ See also "Headers " section in `Req` module documentation.
188188
189189 ## Examples
190190
Original file line number Diff line number Diff line change 11defmodule Req.MixProject do
22 use Mix.Project
33
4- @ version "0.5.9 "
4+ @ version "0.5.10 "
55 @ source_url "https://github.com/wojtekmach/req"
66
77 def project do
You can’t perform that action at this time.
0 commit comments