@@ -128,6 +128,7 @@ module Network.HTTP.Req
132 , parseUrlHttp
133 , parseUrlHttp
133 , parseUrlHttps
134 , parseUrlHttps
@@ -502,12 +503,13 @@ instance HttpMethod method => RequestComponent (Womb "method" method) where
502-- 'Url' from 'ByteString', use 'parseUrlHttp' or 'parseUrlHttps'.
503-- 'Url' from 'ByteString', use 'parseUrlHttp' or 'parseUrlHttps'.
504-- | Request's 'Url'. Start constructing your 'Url' with 'http' or 'https'
505-- | Request's 'Url'. Start constructing your 'Url' with 'http' or 'https'
505−-- specifying the scheme and host at the same time. Then use the @('/:')@
506+-- specifying the scheme and host at the same time. Then use the @('/~')@
506−-- operator to grow path one piece at a time. Every single piece of path
507+-- and @('/:')@ operators to grow path one piece at a time. Every single
507−-- will be url(percent)-encoded, so @('/:')@ is the only way to have forward
508+-- piece of path will be url(percent)-encoded, so @('/:')@ is the only way
508−-- slashes between path segments. This approach makes working with dynamic
509+-- to have forward slashes between path segments. This approach makes
509−-- path segments easy and safe. See examples below how to represent various
510+-- working with dynamic path segments easy and safe. See examples below how
510−-- 'Url's (make sure the @OverloadedStrings@ language extension is enabled).
511+-- to represent various 'Url's (make sure the @OverloadedStrings@ language
512+-- extension is enabled).
512-- ==== __Examples__
514-- ==== __Examples__
@@ -523,7 +525,7 @@ instance HttpMethod method => RequestComponent (Womb "method" method) where
523-- > https "httpbin.org" /: "foo" /: "bar/baz"
525-- > https "httpbin.org" /: "foo" /: "bar/baz"
524-- > -- https://httpbin.org/foo/bar%2Fbaz
526-- > -- https://httpbin.org/foo/bar%2Fbaz
526−-- > https "httpbin.org" /: "bytes" /: (10 :: Int)
528+-- > https "httpbin.org" /: "bytes" /~ (10 :: Int)
527-- > -- https://httpbin.org/bytes/10
529-- > -- https://httpbin.org/bytes/10
529-- > https "юникод.рф"
531-- > https "юникод.рф"
@@ -548,9 +550,16 @@ https = Url Https . pure
548-- | Grow given 'Url' appending a single path segment to it. Note that the
550-- | Grow given 'Url' appending a single path segment to it. Note that the
549-- path segment can be of any type that is an instance of 'ToHttpApiData'.
551-- path segment can be of any type that is an instance of 'ToHttpApiData'.
554+(/~) :: ToHttpApiData a => Url scheme -> a -> Url scheme
555+Url secure path /~ segment = Url secure (NE.cons (toUrlPiece segment) path)
557+-- | Type-constrained version of @('/~')@ to remove ambiguity in cases when
558+-- next URL piece is a 'Text' literal.
551infixl 5 /:
560infixl 5 /:
552−(/:) :: ToHttpApiData a => Url scheme -> a -> Url scheme
561+(/:) :: Url scheme -> Text -> Url scheme
553−Url secure path /: segment = Url secure (NE.cons (toUrlPiece segment) path)
562+(/:) = (/~)
555-- | The 'parseUrlHttp' function provides an alternative method to get 'Url'
564-- | The 'parseUrlHttp' function provides an alternative method to get 'Url'
556-- (possibly with some 'Option's) from a 'ByteString'. This is useful when
565-- (possibly with some 'Option's) from a 'ByteString'. This is useful when