Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options method #8

Merged
merged 2 commits into from
Aug 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion elm-package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.0",
"version": "2.1.0",
"summary": "Extra functions for more easily building and handling Http requests",
"repository": "https://github.com/lukewestby/elm-http-builder.git",
"license": "MIT",
Expand Down
30 changes: 30 additions & 0 deletions src/HttpBuilder.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ module HttpBuilder
, put
, patch
, delete
, options
, trace
, head
, withHeader
, withHeaders
, withBody
Expand Down Expand Up @@ -193,6 +196,33 @@ delete =
requestWithVerbAndUrl "DELETE"


{-| Start building a OPTIONS request with a given URL

options "https://example.com/api/items/1"
-}
options : String -> RequestBuilder
options =
requestWithVerbAndUrl "OPTIONS"


{-| Start building a TRACE request with a given URL

trace "https://example.com/api/items/1"
-}
trace : String -> RequestBuilder
trace =
requestWithVerbAndUrl "TRACE"


{-| Start building a HEAD request with a given URL

head "https://example.com/api/items/1"
-}
head : String -> RequestBuilder
head =
requestWithVerbAndUrl "HEAD"


{-| Add a single header to a request

get "https://example.com/api/items/1"
Expand Down