Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.

Commit

Permalink
change withHeader signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Westby committed Feb 29, 2016
1 parent 4d401ae commit a57f8cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ addItem : String -> Task (HttpExtra.Error String) (HttpExtra.Response (List Stri
addItem item =
HttpExtra.post "http://example.com/api/items"
|> withBody (Http.string "{ \"item\": \"" ++ item ++ "\" }")
|> withHeader ("Content-Type", "application/json")
|> withHeader "Content-Type" "application/json"
|> withTimeout (10 * Time.second)
|> withCredentials
|> send (jsonReader itemsDecoder) stringReader
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Extra.elm
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ delete =
get "https://example.com/api/items/1"
|> withHeader ("Content-Type", "application/json")
-}
withHeader : (String, String) -> RequestBuilder -> RequestBuilder
withHeader header =
mapRequest <| \request -> { request | headers = header :: request.headers }
withHeader : String -> String -> RequestBuilder -> RequestBuilder
withHeader key value =
mapRequest <| \request -> { request | headers = (key, value) :: request.headers }


{-| Add many headers to a request
Expand Down

0 comments on commit a57f8cb

Please sign in to comment.