Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Freckle.App.Http (setRequestMethod)
(#176)
**Why?** As far as I know there are currently 2 ways to use a non-`GET` request method: 1. including method in the request string (e.g. `parseRequest_ $ "POST " <> url`) 2. importing lower-level HTTP module and setting the field directly (e.g. `req { HTTP.method = "POST"}`) **2** breaks the centralization we're providing with this module by requiring consumers to import an internal thing. Also both of these are stringly typed, producing a runtime error if a mistake is made, exs. forgotten space, or casing: > Note that the request method must be provided as all capital letters. ^ from `http-conduit`'s docs. **Note** We could just re-export `Network.HTTP.Simple (setRequestMethod)`, however, still has the stringly-typed problem (it takes a `ByteString`). `StdMethod` gives us nice type-safety and covers all our current (and I'd bet future) use-cases.
- Loading branch information