@@ -174,25 +174,26 @@ defmodule HTTPoison.Base do
174174 @ callback put! ( url , body , headers ) :: Response . t ( ) | AsyncResponse . t ( )
175175 @ callback put! ( url , body , headers , options ) :: Response . t ( ) | AsyncResponse . t ( )
176176
177- @ callback request ( atom , url ) :: { :ok , Response . t ( ) | AsyncResponse . t ( ) } | { :error , Error . t ( ) }
178- @ callback request ( atom , url , body ) ::
177+ @ callback request ( method , url ) :: { :ok , Response . t ( ) | AsyncResponse . t ( ) } | { :error , Error . t ( ) }
178+ @ callback request ( method , url , body ) ::
179179 { :ok , Response . t ( ) | AsyncResponse . t ( ) } | { :error , Error . t ( ) }
180- @ callback request ( atom , url , body , headers ) ::
180+ @ callback request ( method , url , body , headers ) ::
181181 { :ok , Response . t ( ) | AsyncResponse . t ( ) } | { :error , Error . t ( ) }
182- @ callback request ( atom , url , body , headers , options ) ::
182+ @ callback request ( method , url , body , headers , options ) ::
183183 { :ok , Response . t ( ) | AsyncResponse . t ( ) } | { :error , Error . t ( ) }
184184
185- @ callback request! ( atom , url ) :: Response . t ( ) | AsyncResponse . t ( )
186- @ callback request! ( atom , url , body ) :: Response . t ( ) | AsyncResponse . t ( )
187- @ callback request! ( atom , url , body , headers ) :: Response . t ( ) | AsyncResponse . t ( )
188- @ callback request! ( atom , url , body , headers , options ) :: Response . t ( ) | AsyncResponse . t ( )
185+ @ callback request! ( method , url ) :: Response . t ( ) | AsyncResponse . t ( )
186+ @ callback request! ( method , url , body ) :: Response . t ( ) | AsyncResponse . t ( )
187+ @ callback request! ( method , url , body , headers ) :: Response . t ( ) | AsyncResponse . t ( )
188+ @ callback request! ( method , url , body , headers , options ) :: Response . t ( ) | AsyncResponse . t ( )
189189
190190 @ callback start ( ) :: { :ok , [ atom ] } | { :error , term }
191191
192192 @ callback stream_next ( AsyncResponse . t ( ) ) :: { :ok , AsyncResponse . t ( ) } | { :error , Error . t ( ) }
193193
194194 @ type response :: Response . t ( )
195195 @ type request :: Request . t ( )
196+ @ type method :: Request . method ( )
196197 @ type url :: Request . url ( )
197198 @ type headers :: Request . headers ( )
198199 @ type body :: Request . body ( )
@@ -204,6 +205,7 @@ defmodule HTTPoison.Base do
204205 @ behaviour HTTPoison.Base
205206
206207 @ type request :: HTTPoison.Base . request ( )
208+ @ type method :: HTTPoison.Base . method ( )
207209 @ type url :: HTTPoison.Base . url ( )
208210 @ type headers :: HTTPoison.Base . headers ( )
209211 @ type body :: HTTPoison.Base . body ( )
@@ -352,7 +354,7 @@ defmodule HTTPoison.Base do
352354 request(:post, "https://my.website.com", "{\" foo\" : 3}", [{"Accept", "application/json"}])
353355
354356 """
355- @ spec request ( atom , binary , any , headers , Keyword . t ( ) ) ::
357+ @ spec request ( method , binary , any , headers , Keyword . t ( ) ) ::
356358 { :ok , Response . t ( ) | AsyncResponse . t ( ) } | { :error , Error . t ( ) }
357359 def request ( method , url , body \\ "" , headers \\ [ ] , options \\ [ ] ) do
358360 request ( % Request {
@@ -372,7 +374,8 @@ defmodule HTTPoison.Base do
372374 response in case of a successful request, raising an exception in case the
373375 request fails.
374376 """
375- @ spec request! ( atom , binary , any , headers , Keyword . t ( ) ) :: Response . t ( ) | AsyncResponse . t ( )
377+ @ spec request! ( method , binary , any , headers , Keyword . t ( ) ) ::
378+ Response . t ( ) | AsyncResponse . t ( )
376379 def request! ( method , url , body \\ "" , headers \\ [ ] , options \\ [ ] ) do
377380 case request ( method , url , body , headers , options ) do
378381 { :ok , response } -> response
@@ -777,7 +780,7 @@ defmodule HTTPoison.Base do
777780 end
778781
779782 @ doc false
780- @ spec request ( atom , request , fun , fun , fun , fun ) ::
783+ @ spec request ( module , request , fun , fun , fun , fun ) ::
781784 { :ok , Response . t ( ) | AsyncResponse . t ( ) } | { :error , Error . t ( ) }
782785 def request (
783786 module ,
0 commit comments