Skip to content

Commit

Permalink
add docs for withBody
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Westby committed Mar 6, 2017
1 parent 69ce294 commit 8b466b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/HttpBuilder.elm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ configuration than what is provided by `elm-http` out of the box.
@docs RequestBuilder, get, post, put, patch, delete, options, trace, head
# Configure request properties
@docs withHeader, withHeaders, withStringBody, withJsonBody, withMultipartStringBody, withUrlEncodedBody, withTimeout, withCredentials, withQueryParams, withExpect, withCacheBuster
@docs withHeader, withHeaders, withBody, withStringBody, withJsonBody, withMultipartStringBody, withUrlEncodedBody, withTimeout, withCredentials, withQueryParams, withExpect, withCacheBuster
# Make the request
@docs toRequest, toTask, send
Expand Down Expand Up @@ -173,6 +173,10 @@ withHeaders headerPairs builder =
}


{-| Add an Http.Body to the request
post "https://example.com/api/save-text"
|> withBody (Http.stringBody "text/plain" "Hello!")
-}
withBody : Http.Body -> RequestBuilder a -> RequestBuilder a
withBody body builder =
{ builder | body = body }
Expand Down

0 comments on commit 8b466b2

Please sign in to comment.