<6)J      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None Safe-Inferred   Safe-Inferred-       (c) 2014 Bryan O'Sullivan BSD-stylebos@serpentine.com experimentalGHCNone !"+-24HMmA session that spans multiple requests. This is responsible for cookie management and TCP connection reuse.DA function that runs a request and returns the associated response.(A request that is ready to be submitted.An element of a Link header.The error type used by   and  ; if a failure occurs when parsing a response body as JSON.A key/value pair for an !application/x-www-form-urlencoded POST request body.TA type that can be rendered as the value portion of a key/value pair for use in an !application/x-www-form-urlencoded' POST body. Intended for use with the  type.The instances for  , strict  , and lazy   7 are all encoded using UTF-8 before being URL-encoded.The instance for  gives an empty string on 4, and otherwise uses the contained type's instance.Render the given value.;A product type for representing more complex payload types. 8A type that can be converted into a PUT request payload.!RRepresent a value in the request body (and perhaps the headers) of a PUT request."9A type that can be converted into a POST request payload.#SRepresent a value in the request body (and perhaps the headers) of a POST request.%AWS request signing version 4&Supported authentication types.Do not use HTTP authentication unless you are using TLS encryption. These authentication tokens can easily be captured and reused by an attacker if transmitted in the clear.'>Amazon Web Services request signing AWSAuthVersion key secret(A not-quite-standard OAuth2 bearer token (that seems to be used only by GitHub). This is treated by whoever accepts it as the equivalent of a username and password.)gAn OAuth2 bearer token. This is treated by many services as the equivalent of a username and password.*FBasic authentication. This consists of a plain username and password.+!Options for configuring a client.-Either configuration for a , or an actual .If only & are provided, then by default a new " will be created for each request.Note#: when issuing HTTP requests using +-based functions from the the Network.Wreq.Session module (, %, etc.), this field will be ignored.'An example of using a specific manager: import Network.HTTP.Client ()  $ \mgr -> do let opts =  { - = Right mgr }  opts "http://httpbin.org/get" ;An example of changing settings (this will use a separate U for every request, so make sense only if you're issuing a tiny handful of requets): import Network.HTTP.Client () let settings = % { managerConnCount = 5 } opts =  { - = Left settings }  opts "http://httpbin.org/get" ..Host name and port for a proxy to use, if any./Authentication information.Example (note the use of TLS):  let opts =  { / =  "user" "pass" } 2 opts "https://httpbin.org/basic-auth/user/pass" 0-Additional headers to send with each request.  let opts =  { 0 = [("Accept", "*/*")] }  opts "http://httpbin.org/get" 1LKey-value pairs to assemble into a query string to add to the end of a URL.For example, given:  let opts = 7 { params = [("sort", "ascending"), ("key", "name")] }  opts "http://httpbin.org/get" %This will generate a URL of the form: .http://httpbin.org/get?sort=ascending&key=name2[The maximum number of HTTP redirects to follow before giving up and throwing an exception.In this example, a  will be thrown with a P constructor, because the maximum number of redirects allowed will be exceeded:  let opts =  { 2 = 3 } ' opts "http://httpbin.org/redirect/5" 3%Cookies to set when issuing requests.Note#: when issuing HTTP requests using +-based functions from the the Network.Wreq.Session module (, /, etc.), this field will be used only for the first% HTTP request to be issued during a D. Any changes changes made for subsequent requests will be ignored.4JFunction that checks the status code and potentially returns an exception.This defaults to &, which will just use the default of  which throws a StatusException if the status is not 2XX.5A MIME content type, e.g. "application/octet-stream".6)Return the URL associated with the given .SThis includes the port number if not standard, and the query string if one exists.: !"#$%&'()*+,-./01234565 !"#$%&'()*+,-./0123456 !"#$%&*)('+ ,-./0123456NoneHM;Set a header to the given value, replacing any prior value.MSet a header to the given value, but only if the header was not already set.777None(c) 2014 Bryan O'Sullivan BSD-stylebos@serpentine.com experimentalGHCNone24$% !"#$%&'()*+,-./0123456%+,-./01234&*)('$%"# !56$None           None3HM+ !"#$%&'()*+,-./0123456781 + !"#$%&'()*+,-./01234678+ !"#$%&'()*+,-./012345678(c) 2014 Bryan O'Sullivan BSD-stylebos@serpentine.com experimentalGHCNoneHM*8YA lens onto configuration of the connection manager provided by the http-client package.RIn this example, we enable the use of OpenSSL for (hopefully) secure connections: import OpenSSL.Session ( ) import Network.HTTP.Client.OpenSSL let opts =   8   Left (!" ) !# $ ! opts "https://httpbin.org/get" HIn this example, we also set the response timeout to 10000 microseconds: import OpenSSL.Session ( ) import Network.HTTP.Client.OpenSSL import Network.HTTP.Client (, $) let opts =   8   Left (!" )  8   Left ( { $ = Just 10000 } ) !# $ ! opts "https://httpbin.org/get" 9 A lens onto proxy configuration.Example:  let opts =   9 % & "localhost" 8000  opts "http://httpbin.org/get" Note here the use of the % setter to turn a  into a  3, to make the type of the RHS compatible with the '( lens.:#A lens onto request authentication.Example (note the use of TLS):  let opts =   ') %  "user" "pass" 2 opts "https://httpbin.org/basic-auth/user/pass" ;VA lens onto all headers with the given name (there can legitimately be zero or more).Example:  let opts =   ; "Accept"   ["*/*"]  opts "http://httpbin.org/get" <AA lens onto all headers (there can legitimately be zero or more).NIn this example, we print all the headers sent by default with every request. print ( * <) =_A lens onto all query parameters with the given name (there can legitimately be zero or more)..In this example, we construct the query URL "'http://httpbin.org/get?foo=bar&foo=quux".  let opts =   = "foo"   ["bar", "quux"]  opts "http://httpbin.org/get" >!A lens onto all query parameters.?aA lens onto the maximum number of redirects that will be followed before an exception is thrown.In this example, a  will be thrown with a P constructor, because the maximum number of redirects allowed will be exceeded.  let opts =   ?   3 ' opts "http://httpbin.org/redirect/5" @0A lens to get the optional status check functionA?A traversal onto the cookie with the given name, if one exists.N.B. This is an "illegal" 9: we can change the C of the associated = so that it differs from the name provided to this function.BA lens onto all cookies.C!A lens onto the name of a cookie.D"A lens onto the value of a cookie.E(A lens onto the expiry time of a cookie.F#A lens onto the domain of a cookie.G!A lens onto the path of a cookie.H*A lens onto the creation time of a cookie.I-A lens onto the last access time of a cookie.J`A lens onto whether a cookie is persistent across sessions (also known as a "tracking cookie").K*A lens onto whether a cookie is host-only.LVA lens onto whether a cookie is secure-only, such that it will only be used over TLS.M,A lens onto whether a cookie is "HTTP-only".Such cookies should be used only by browsers when transmitting HTTP requests. They must be unavailable in non-browser environments, such as when executing JavaScript scripts.N:A lens onto the hostname portion of a proxy configuration.O9A lens onto the TCP port number of a proxy configuration.P+A lens onto the status of an HTTP response.Q,A lens onto the version of an HTTP response.R;A lens onto all matching named headers in an HTTP response.cTo access exactly one header (the result will be the empty string if there is no match), use the (* ) operator. r <- +# "http://httpbin.org/get" print (r * R "Content-Type") 1To access at most one header (the result will be " if there is no match), use the (, ) operator. r <- +# "http://httpbin.org/get" print (r , R "Content-Transfer-Encoding") 9To access all (zero or more) matching headers, use the (- ) operator. r <- +# "http://httpbin.org/get" print (r - R "Set-Cookie") S,A lens onto all headers in an HTTP response.T A fold over Link5 headers, matching on both parameter name and value.For example, here is a Link* header returned by the GitHub search API. Link: <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=2>; rel="next", <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=34>; rel="last">And here is an example of how we can retrieve the URL for the next link programatically. r <- +G "https://api.github.com/search/code?q=addClass+user:mozilla" print (r , T "rel" "next" . Z) U#A lens onto the body of a response. r <- +# "http://httpbin.org/get" print (r * U) V2A fold over any cookies that match the given name. r <- +$ "http://www.nytimes.com/" print (r , responseCookie "RMID") W,A lens onto all cookies set in the response.X5A lens onto the numeric identifier of an HTTP status.Y6A lens onto the textual description of an HTTP status.Z!A lens onto the URL portion of a Link element.[ A lens onto the parameters of a Link element.\A lens onto the name of the  input: element associated with part of a multipart form upload.]JA lens onto the filename associated with part of a multipart form upload.^NA lens onto the content-type associated with part of a multipart form upload._\A lens onto the code that fetches the data associated with part of a multipart form upload.`Turn an attoparsec : into a ;.PBoth headers and bodies can contain complicated data that we may need to parse.Example: when responding to an OPTIONS request, a server may return the list of verbs it supports in any order, up to and including changing the order on every request (which httpbin.org /actually does/!). To deal with this possibility, we parse the list, then sort it.,import Data.Attoparsec.ByteString.Char8 as Aimport Data.List (sort))let comma = skipSpace >> "," >> skipSpace3let verbs = A.takeWhile isAlpha_ascii `sepBy` comma%r <- options "http://httpbin.org/get"2r ^. responseHeader "Allow" . atto verbs . to sort["GET","HEAD","OPTIONS"]a The same as `9, but ensures that the parser consumes the entire input.Equivalent to: a myParser = ` (myParser < =) *89:;<=>?@ABCDEFGHIJKLMNOPQRHeader name to match.STParameter name to match.Parameter value to match.UVName of cookie to match.WXYZ[\]^_`a1 +89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a1+89:;=?<>AB@NOCDEFGHIJKLMURTVSWPQ XYZ[\]^_`a*89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`aNone+-0>?@ABCDEFGHIbJKLMcdNOPQbcddcb > HGFEDCBA@?IbJKLMcdNOPQ.None!"ReSTUVWXYZ[\]^_`abcdefgReTUVWX_`abcdefgReSTUVWXYZ[\]^_`abcdefg(c) 2014 Bryan O'Sullivan BSD-stylebos@serpentine.com experimentalGHCNone3fIssue a GET request.Example: f "http://httpbin.org/get" !r <- get "http://httpbin.org/get" r ^. responseStatus . statusCode200h(Issue a GET request, using the supplied +.Example:  let opts = e h = "foo" i ["bar"] h opts "http://httpbin.org/get" ,let opts = defaults & param "foo" .~ ["bar"]*r <- getWith opts "http://httpbin.org/get"r ^? responseBody . key "url".Just (String "http://httpbin.org/get?foo=bar")iIssue a POST request.Example: i "http://httpbin.org/post" (j [1,2,3]) 4r <- post "http://httpbin.org/post" (toJSON [1,2,3])r ^? responseBody . key "json":Just (Array (fromList [Number 1.0,Number 2.0,Number 3.0]))j)Issue a POST request, using the supplied +.Example:  let opts = e h = "foo" i ["bar"] j! opts "http://httpbin.org/post" (j [1,2,3]) ,let opts = defaults & param "foo" .~ ["bar"]=r <- postWith opts "http://httpbin.org/post" (toJSON [1,2,3])r ^? responseBody . key "url"/Just (String "http://httpbin.org/post?foo=bar")kIssue a HEAD request.Example: k "http://httpbin.org/get" #r <- head_ "http://httpbin.org/get""r ^? responseHeader "Content-Type"Just "application/json"l)Issue a HEAD request, using the supplied +.Example:  let opts = e h = "foo" i ["bar"] l opts "http://httpbin.org/get" ,let opts = defaults & param "foo" .~ ["bar"]+r <- headWith opts "http://httpbin.org/get" r ^? responseHeader "Connection"Just "keep-alive"mIssue a PUT request.n(Issue a PUT request, using the supplied +.oIssue an OPTIONS request.Example: o "http://httpbin.org/get" See `# for a more complex worked example.p-Issue an OPTIONS request, using the supplied +.Example:  let opts = e h = "foo" i ["bar"] p opts "http://httpbin.org/get" qIssue a DELETE request.Example: q "http://httpbin.org/delete" 'r <- delete "http://httpbin.org/delete" r ^. responseStatus . statusCode200r+Issue a DELETE request, using the supplied +.Example:  let opts = e h ? i 0 r# opts "http://httpbin.org/delete" $let opts = defaults & redirects .~ 00r <- deleteWith opts "http://httpbin.org/delete" r ^. responseStatus . statusCode200sIssue a custom-method request Example:  s% "PATCH" "http://httpbin.org/patch" 4r <- customMethod "PATCH" "http://httpbin.org/patch" r ^. responseStatus . statusCode200t:Issue a custom request method request, using the supplied +.Example:  let opts = e h ? i 0 t* "PATCH" opts "http://httpbin.org/patch" $let opts = defaults & redirects .~ 0=r <- customMethodWith "PATCH" opts "http://httpbin.org/patch" r ^. responseStatus . statusCode200wKConvert the body of an HTTP response from JSON to a suitable Haskell type.In this example, we use w in the IO monad, where it will throw a 4 exception if conversion to the desired type fails. ' {-# LANGUAGE DeriveGeneric #-} import  GHC.Generics (/0) {- This Haskell type corresponds to the structure of a response body from httpbin.org. -} data GetBody = GetBody { headers :: 12   , args :: 12   , origin ::  , url ::  } deriving (Show, /0) -- Get GHC to derive a k instance for us. instance k GetBody {- The fact that we want a GetBody below will be inferred by our use of the "headers" accessor function. -} foo = do r <- w =<< f. "http://httpbin.org/get" print (headers (r *  responseBody))  If we use w in the l monad, it will return m with a " payload if conversion fails, and n with a  whose  responseBody# is the converted value on success.x4Convert the body of an HTTP response from JSON to a Value.In this example, we use x in the IO monad, where it will throw a  exception if the conversion to Value fails. foo = do r <- x =<< f% "http://httpbin.org/get" print (r ,  responseBody& . key "headers" . key "User-Agent") yFBasic authentication. This consists of a plain username and password.Example (note the use of TLS):  let opts = e h : ?~ y "user" "pass" h2 opts "https://httpbin.org/basic-auth/user/pass" Note here the use of the % setter to turn an & into a  &3, to make the type of the RHS compatible with the : lens.5let opts = defaults & auth ?~ basicAuth "user" "pass"<r <- getWith opts "https://httpbin.org/basic-auth/user/pass"'r ^? responseBody . key "authenticated"Just (Bool True)zgAn OAuth2 bearer token. This is treated by many services as the equivalent of a username and password.Example (note the use of TLS):  let opts = e h : ?~ z "1234abcd" h6 opts "https://public-api.wordpress.com/rest/v1/me/" {A not-quite-standard OAuth2 bearer token (that seems to be used only by GitHub). This will be treated by whatever services accept it as the equivalent of a username and password.Example (note the use of TLS):  let opts = e h : ?~ { "abcd1234" h% opts "https://api.github.com/user" |AWS v4 request signature.Example (note the use of TLS):  let opts = e h : ?~ 'awsAuth AWSv4' "key" "secret" h2 opts "https://dynamodb.us-west-2.amazonaws.com" }Proxy configuration.Example:  let opts = e h 9 ?~ } "localhost" 8000 h opts "http://httpbin.org/get" Note here the use of the % setter to turn a  into a  3, to make the type of the RHS compatible with the 9 lens.~Make a Part whose content is a strict , encoded as UTF-8.The Part? does not have a file name or content type associated with it.Make a Part whose content is a , encoded as UTF-8.The Part? does not have a file name or content type associated with it.fghijklmnopqrstuvwxy Username. Password.z{|}~"Name of the corresponding <input>.The body for this ."Name of the corresponding <input>.The body for this .R $%&+89:;<=>?@ABCDEFGPRSTUVWXYZ[\]^_`aefghijklmnopqrstuvwxyz{|}~Rfhijklopmnqrstuv+e8;=?<>AB@&$%:yz{|9}g\]^_~URTVSWP XYZ[wxCDEFG`afghijklmnopqrstuvwxyz{|}~(c) 2014 Bryan O'Sullivan BSD-stylebos@serpentine.com experimentalGHCNoneHM Create a *, passing it to the given function. The 5 will no longer be valid after that function returns.3Create a session, using the given manager settings.-specific version of +.-specific version of 3.-specific version of 4.-specific version of 5.-specific version of 6.-specific version of 7.-specific version of .-specific version of 8.-specific version of 9.-specific version of :.-specific version of .-specific version of ;.opqrs77opqrst<=><=?<=@<=A<=B<CD<CE<CE<CFGHIJKLM7NO  P Q R R S T U U V W X Y Z [ \ ] ^ _ ` a b c d e f g g h ( ) i j k l m n oph()qirjkmsltuvwxyz{|}~ST.+384965:7;  &+3456789:;J <C<C<C        p Q  m(     r)mlihj(kywv|~ztx{}uTSrqs !"#$% &'()*+,-./0123456789:;..<.=.>.?.@.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.PQR STUSTVWXWYWZ[\B]^_ wreq-0.3.0.1 Network.WreqNetwork.Wreq.LensNetwork.Wreq.Cache.StoreNetwork.Wreq.SessionNetwork.Wreq.TypesNetwork.Wreq.CacheNetwork.Wreq.Lens.Machinery Paths_wreqNetwork.Wreq.Internal.TypesasJSONasValueData.Text.LazyTextgetWithputWithNetwork.HTTP.Client withManagerdefaultsdefaultManagerSettings basicAuth HttpExceptionTooManyRedirectsSessionNetwork.Wreq.Internal.LensNetwork.Wreq.Internal.AWSNetwork.Wreq.Internal.LinkNetwork.Wreq.Lens.THOpenSSL.Sessioncontext Control.Lens&.~Network.HTTP.Client.OpenSSLopensslManagerSettings withOpenSSLmanagerResponseTimeout?~ httpProxyLensproxyauth^.get^?^..Network.Wreq.Internal GHC.GenericsGenericData.MapMapposthead_optionsputdeletepostWithheadWith optionsWith deleteWithhttp-client-0.4.6.1%Network.HTTP.Client.MultipartFormDatapartFileSourcepartFilepartLBSpartBSPartNetwork.HTTP.Client.TypesCookieProxyResponsehttp-types-0.8.5Network.HTTP.Types.StatusStatusStoreemptyinsertlookupfromListtoListRunReqLinklinkURL linkParams JSONError FormParam:= FormValuerenderFormValuePayloadRawPutable putPayloadPostable postPayloadAWSAuthVersionAWSv4AuthAWSAuth OAuth2Token OAuth2Bearer BasicAuthOptionsmanagerheadersparams redirectscookies checkStatus ContentTypereqURLseshRunheaderparamcookie cookieName cookieValuecookieExpiryTime cookieDomain cookiePathcookieCreationTimecookieLastAccessTimecookiePersistentcookieHostOnlycookieSecureOnlycookieHttpOnly proxyHost proxyPortresponseStatusresponseVersionresponseHeaderresponseHeaders responseLink responseBodyresponseCookieresponseCookieJar statusCode statusMessagepartName partFileNamepartContentType partGetBodyattoatto_ cacheStore validateEntry shouldCache customMethodcustomMethodWithfoldGet foldGetWith oauth2Bearer oauth2TokenawsAuthpartText partString withSessionwithSessionWith defaultRules fieldName makeLenses toCamelCasecatchIOversionbindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNamecapacitysizeepochlrumapEpoch $fShowStorebaseGHC.BaseString text-1.2.0.3Data.Text.Internal Data.MaybeMaybeNothingManagerManagerSettingsRequestBody ReaderBody StringBodyNoBody CacheEntry entryCreated entryExpires entryResponse seshCookies seshManagerMgr$fShowCacheEntry $fShowSession$fExceptionJSONError$fShowFormParam $fShowOptions setHeadermaybeSetHeader cookieJar decompressgetConnectionWrapperhost hostAddressmethodonRequestBodyExceptionpathport queryStringrawBody redirectCount requestBodyrequestHeadersrequestVersionresponseTimeoutsecureassocassoc2 deleteKey signRequest signRequestV4addTmpPayloadHashHeadertmpPayloadHashHeaderserviceAndRegionremoveRunscopepayload$fFormValueMaybe $fFormValue()$fFormValueDouble$fFormValueFloat$fFormValueWord64$fFormValueWord32$fFormValueWord16$fFormValueWord8$fFormValueWord$fFormValueInteger$fFormValueInt64$fFormValueInt32$fFormValueInt16$fFormValueInt8$fFormValueInt$fFormValueByteString$fFormValueByteString0 $fFormValue[]$fFormValueBuilder$fFormValueText$fFormValueText0$fPutableValue$fPutableByteString$fPutableByteString0$fPutablePayload$fPostableValue$fPostableByteString$fPostableByteString0$fPostablePayload$fPostableFormParam $fPostable[] $fPostable(,) $fPostable[]0 $fPostable[]1$fPostablePartQuot BackslashLiterallinkslink quotedString paramNameresponseClose' partFilename partHeaders _CookieJar lens-4.6.0.1Control.Lens.Type Traversal'attoparsec-0.12.1.2#Data.Attoparsec.ByteString.InternalParserFoldControl.Applicative<*Data.Attoparsec.Internal endOfInput CacheResponse ExtensionSMaxAgeMaxAgeProxyRevalidateMustRevalidate NoTransformNoStoreNoCachePrivatePublicSecondscacheableStatusescacheableMethodspossiblyCacheablecomputeExpirationsimplifyCacheResponseparseCacheResponse parseDate$fHashableCacheResponse setRedirectsemptyMethodWithignoreResponse readResponsefoldResponseBodyrequestrunpreparesetQuerysetAuthsetProxysetCheckStatus prepareGetrunRead preparePost prepareMethod prepareHead runIgnoreprepareOptions preparePut prepareDeleteControl.Lens.LensControl.Lens.Setter aeson-0.8.0.2Data.Aeson.Types.ClasstoJSONFromJSON Data.EitherEitherLeftRightMappingrunWithstringignore