haskell-servant / haskell-servant/servant

servant-client: Support adding trailing slashes to API requests

Open
#645 17 comments 1 reaction 0 assignees View on GitHub
enhancement servant-client
Dominant language
Haskell
Stars
2k
Forks
427
Avg merge
2d 23h
Merged PRs (30d)
5

Description

I'm attempting to use servant-client to communicate with an API that expects all routes to end with a trailing slash. On GET requests, they return a redirect status code, so the client ends up at the proper API endpoint eventually. However, on POST/PUT/DELETE, they just return `Method Not Allowed`. It would be great if there was a way to configure servant to output optionally output trailing slashes.

A more general idea might be to introduce a function to ClientM that modifies each request prior to sending or something along those lines.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.