haskell-servant / haskell-servant/servant

Question about QueryParam encoding

Open
#1,100 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
2k
Forks
427
Avg merge
2d 23h
Merged PRs (30d)
5

Description

Hi, I have just used Servant for the first time.
Everything has been great and easy to use.

However, I have one tiny issue I can't figure out:

I have an API that takes a `QueryParam "q" String`. (This is a call against the GitHub API).
The values usually like similar to this:
`is:open+review-requested:tsteinbach` (Find all PRs I was requested to review)

When I make the actual call, the `:` and `+` have been encoded by Servant (I am sending the request to a `nc -l localhost 8081`).
Is there a way to prevent that? It would appear that the GitHub API does not like the encoded values.

If I use `curl`, the parameters are not encoded and the API returns what I expect (once I point it at the actual GitHub host):
` λ curl -i -H 'Authorization: token XXX' http://localhost:8081/api/v3/search/issues\?q\=is:open+review-requested:tsteinbach`

Thank you very much.

Edit: I worked around this by using a space character instead of `+` (apparently GitHub was only unhappy about that one, they are equivalent in the search API). I am still interested in whether a solution is available for using `+`

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.