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

Commit

Permalink
fix send doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Westby committed Feb 9, 2016
1 parent 8c09104 commit 518e1b5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Http/Extra.elm
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,21 @@ type Error a
| BadResponse (Response a)


{-| Once you're finished building up a request, send it with a given decoder
{-| Once you're finished building up a request, send it with decoders for the
successful response object as well as the server error response object
successDecoder : Json.Decode.Decoder (List String)
successDecoder =
Json.Decode.list Json.Decode.string
errorDecoder : Json.Decode.Decoder String)
errorDecoder =
Json.Decode.string
get "https://example.com/api/items"
|> withHeader ("Content-Type", "application/json")
|> withTimeout (10 * Time.second)
|> send (Json.Decoder.list Json.Decoder.string)
|> send successDecoder errorDecoder
-}
send : Json.Decoder a -> Json.Decoder b -> RequestBuilder -> Task (Error b) (Response a)
send successDecoder errorDecoder (RequestBuilder request settings) =
Expand Down

0 comments on commit 518e1b5

Please sign in to comment.