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 Freckle.App.Http (setRequestMethod) #176

Merged
merged 1 commit into from
Jun 24, 2024

Commits on Jun 21, 2024

  1. Add Freckle.App.Http (setRequestMethod)

    **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.
    mjgpy3 committed Jun 21, 2024
    Configuration menu
    Copy the full SHA
    6467e5b View commit details
    Browse the repository at this point in the history