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

Query string support (more sophisticated URIs) #2

Open
tel opened this issue Nov 26, 2013 · 2 comments
Open

Query string support (more sophisticated URIs) #2

tel opened this issue Nov 26, 2013 · 2 comments

Comments

@tel
Copy link

tel commented Nov 26, 2013

While query strings are almost out of scope of the HTTP spec, in practice they are of course completely ubiquitous. While it's possible to encode them in the current API, it's certainly not possible to do it with any type safety or ease as the path component of a Request is just an untyped ByteString.

This is particularly hairy when trying to process a request just prior to sending, such as to append cryptographic signature information.

URIs have a lot more structure than that according to rfc3986, so it'd be nice to expose that structure more easily in the interface to http-common.

I propose adding more structured ways to query and build paths used in building Requests. This could be done by building atop existing URI packages like network, http-types, or uri. It also might be worth considering a fresh implementation if none of those packages provide an API which fits "nicely" into http-common's methods.

In particular, network is very old, uri and network both use String types, and http-types brings along more types, like Method, already replicated in http-common.

@istathar
Copy link
Member

At the moment http-streams depends on network (which we'd need anyway) but is where we get the Network.URI code to parse URLs in order to extract e.g. port numbers in the convenience methods. So if there's something there that does what you need then that would be useful to know.

AfC

@istathar
Copy link
Member

So is there an existing library that does URIs properly (to your requirement)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants