Skip to content

Commit

Permalink
Fix Req.get example and Req.head typespec (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivkorn authored Nov 2, 2023
1 parent 3543f56 commit b40de7b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/req.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ defmodule Req do
* `:url` - the request URL.
* `:headers` - the request headers as a `{key, value}` enumerable (e.g. map, keyword list).
* `:headers` - the request headers as a `{key, value}` enumerable (e.g. map, keyword list).
The header names should be downcased.
Expand Down Expand Up @@ -529,7 +529,7 @@ defmodule Req do
With options:
iex> {:ok, resp} = Req.get!(url: "https://api.github.com/repos/wojtekmach/req")
iex> {:ok, resp} = Req.get(url: "https://api.github.com/repos/wojtekmach/req")
iex> resp.status
200
Expand Down Expand Up @@ -618,7 +618,8 @@ defmodule Req do
"""
@doc type: :request
@spec head(url() | keyword() | Req.Request.t(), options :: keyword()) :: Req.Response.t()
@spec head(url() | keyword() | Req.Request.t(), options :: keyword()) ::
{:ok, Req.Response.t()} | {:error, Exception.t()}
def head(request, options \\ []) do
request(%{new(request, options) | method: :head})
end
Expand Down

0 comments on commit b40de7b

Please sign in to comment.