on master help sign in
More corrections related to the fresh URL section
commit524a5b30609d1b3210537b5a832c59e8f86280a7 authormrkkrp <markkarpov@opmbx.org> dateTue 25 Oct 2016, 01:11 (10 years ago) parent4f10a58
1 file changed+16−12
Network/HTTP/Req.hs+16−12
Network/HTTP/Req.hs+16−12
@@ -25,14 +25,15 @@
2525--
2626-- “Type-safe” means that the library is protective and eliminates certain
2727-- class of errors compared to alternative libraries like @wreq@ or vanilla
28−-- @http-client@. For example it makes sure that user does not send request
29−-- body when using methods like 'GET' or 'DELETE', minimizes amount of
30−-- implicit assumptions making user specify his\/her intentions in explicit
31−-- form (for example it's not possible to avoid specifying body or method of
32−-- a request). It carefully hides underlying types from lower-level
33−-- @http-client@ package because it's not type safe enough (for example
34−-- 'L.Request' is an instance of 'Data.String.IsString' and if it's
35−-- malformed, it will blow up at run-time).
28+-- @http-client@. For example we have correct-by-construction 'Url's, it's
29+-- guaranteed that user does not send request body when using methods like
30+-- 'GET' or 'DELETE', amount of implicit assumptions is minimized by making
31+-- user specify his\/her intentions in explicit form (for example it's not
32+-- possible to avoid specifying body or method of a request). It carefully
33+-- hides underlying types from lower-level @http-client@ package because
34+-- it's not type safe enough (for example 'L.Request' is an instance of
35+-- 'Data.String.IsString' and if it's malformed, it will blow up at
36+-- run-time).
3637--
3738-- “Expandable” refers to the ability of the library to be expanded without
3839-- ugly hacking. For example it's possible to define your own HTTP methods,
@@ -403,17 +404,20 @@ instance HttpMethod method => RequestComponent (Womb "method" method) where
403404--
404405-- ==== __Examples__
405406--
406−-- > -- http://httpbin.org
407407-- > http "httpbin.org"
408+-- > -- http://httpbin.org
408409--
409−-- > -- https://httpbin.org
410410-- > https "httpbin.org"
411+-- > -- https://httpbin.org
411412--
412−-- > -- https://httpbin.org/encoding/utf8
413413-- > https "httpbin.org" /: "encoding" /: "utf8"
414+-- > -- https://httpbin.org/encoding/utf8
415+--
416+-- > https "httpbin.org" /: "foo" /: "bar/baz"
417+-- > -- https://httpbin.org/foo/bar%2Fbaz
414418--
415−-- > -- https://%D1%8E%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4.%D1%80%D1%84
416419-- > https "юникод.рф"
420+-- > -- https://%D1%8E%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4.%D1%80%D1%84
417421
418422data Url = Url Bool (NonEmpty Text)
419423 -- NOTE The first 'Bool' value specifies if the 'Url' has “https” as its