Open rgrinberg opened 9 years ago
Uri of Uri.t | Ip of Ip_addr.t * int | Pipe of ic * oc
as suggested by @rgrinberg on Gitter is exactly what I need :+1: :+1: :+1:
I plan on providing both an Uri.t
and an Ip_addr.t * int
tuple. That way I can have strict control over address resolution, manipulation and caching while retaining the high level Uri abstractions. Best of both worlds.
Personally, this is my single most desired feature for cohttp.
The above reference a possible type for targeting a cohttp client. Uri u
would give us the current behavior.
Access to the raw request Uri would be useful in some situations (e.g. S3 sign requests using an HMAC, and you need to verify the signature on the original Uri, not a normalized variant of it).
Ocsigen provides this, would be nice if Cohttp did too.
The {Request,Response}.uri
solution would work for me if the original Uri is also available as a string.
Currently cohttp is hardcoded to use Uri when both creating requests and reading responses. Here are some disadvantages of that:
(ic, oc)
pair.The biggest problem here is obviously the first one since there's absolutely no work arounds but the others are important too. This change is also congruent with our goal of keeping cohttp low level and flexible.
The amount of breakage this would cause should range from minimal to moderate for our users:
{Request,Response}.uri
respectivelyrequest
will need an extra parameter to know where to connect to. Since the request would only have a string for the path and query parameters.@avsm @dsheets @SGrondin thoughts?