[web-devel] ALPHA: http-types 0.1
michael at snoyman.com
Fri Feb 4 11:05:03 CET 2011
On Fri, Feb 4, 2011 at 10:16 AM, Aristid Breitkreuz
<aristidb at googlemail.com> wrote:
> Writing this from my phone, so I'll be brief.
> I'm OK with the name CIByteString, I just thought the Http would clarify
> that this is not safe for different encodings. But I can change this.
> Parsing/rendering sounds like a good idea. I will probably use different
> function names, but you can set up aliases in wai-extra, right?
Yes, for functions I don't care what you name things. It's
specifically data constructors that breaks backwards compatibility.
> Headers are already there, no? You're confusing me.
I was talking about the semi-exhaustive list of headers that people
often request, eg hdrAccept = "Accept", hdrContentType =
"Content-Type", etc. It was brought up in the original thread.
> Thanks for the nice feedback!
> "sent from my Android"
> Am 04.02.2011 07:09 schrieb "Michael Snoyman" <michael at snoyman.com>:
> Alright, everything seems fine to me. Some more comments:
> * Besides the fact that I think HttpCIByteString is too verbose, it
> presents another problem: I cannot transparently switch over to it in
> WAI and http-enumerator. If you kept the same name (CIByteString), I
> could simply switch over to your version without any breaking changes.
> * I like methodGet et al.
> * Do you want to consider some parsing functions? I can provide you
> the code. Some things I would imagine would be:
> * parseQueryString :: ByteString -> [(ByteString, Maybe
> ByteString)] (I'm not sure if in practice anyone cares about the Maybe
> btw, but you are right that it is more theoretically correct)
> * renderQueryString :: [(ByteString, Maybe ByteString)] -> ByteString
> * parsePath :: ByteString -> [String], which would do all
> splitting-on-slash, percent decoding and UTF-8 decoding
> * renderPath :: [String] -> ByteString, which would be the reverse
> of parsePath
> * renderPathQuery :: [String] -> [(ByteString, ByteString)] -> ByteString
> * parseHttpAccept :: ByteString -> [ByteString]
> * Are you planning on adding headers as well?
> Basically, feel free to raid Network.Wai.Parse.
> On Fri, Feb 4, 2011 at 12:23 AM, Aristid Breitkreuz
> <aristidb at googlemail.com> wrote:
>> OK, I uploaded a fixed version:
More information about the web-devel