Îõ³h$'^%¸Á      !"#$%&'()*+,-./0123456789:;<=>?@None 3‹ http-commonThe map of headers in a  or  É. Note that HTTP header field names are case insensitive, so if you call  setHeaderë on a field that's already defined but with a different capitalization you will replace the existing value. http-commonÍAccessors common to both the outbound and return sides of an HTTP connection.ûMost people do not need this; for most cases you just need to get a header or two from the response, for which you can use ,Æ. On the other hand, if you do need to poke around in the raw headers, import Network.Http.Types will give you functions like 1 and . to to work with. http-common,Get the Headers from a Request or Response.y  http-commonïA description of the response received from the server. Note unlike other HTTP libraries, the response body is notÅ a part of this object; that will be streamed in by you when calling receiveResponse.Like ,   has a Showæ instance that will output the status line and response headers as they were received from the server. http-commonôA description of the request that will be sent to the server. Note unlike other HTTP libraries, the request body is notà a part of this object; that will be streamed out by you when actually sending the request with  sendRequest. has a useful Showç instance that will output the request line and headers (as it will be sent over the wire but with the \r7 characters stripped) which can be handy for debugging.Note that the actual Host:ë header is not set until the request is sent, so you will not see it in the Show instance (unless you call  setHostname+ to override the value inherited from the  Connection). http-commonHTTP Methods, as per RFC 2616( http-commonöGenerate a random string to be used as an inter-part boundary in RFC 7578 multipart form data. You pass this value to  and subsequently to .) http-common™If you want to fix the multipart boundary to a known value (for testing purposes) you can use this. The ideal such string, in case you are wondering, is "bEacHV0113YB@ll".ñThis isn't safe for use in production; you need to use an unpredictable value as the boundary separtor so prefer (.* http-common"Get the HTTP response status code.+ http-commonÀGet the HTTP response status message. Keep in mind that this is not normative; whereas * values are authoritative., http-common¤Lookup a header in the response. HTTP header field names are case-insensitive, so you can specify the name to lookup however you like. If the header is not present Nothing will be returned. õ let n = case getHeader p "Content-Length" of Just x' -> read x' :: Int Nothing -> 0Ÿwhich of course is essentially what goes on inside the client library when it receives a response from the server and has to figure out how many bytes to read.³There is a fair bit of complexity in some of the other HTTP response fields, so there are a number of specialized functions for reading those values where we've found them useful.. http-common–Set a header field to the specified value. This will overwrite any existing value for the field. Remember that HTTP fields names are case insensitive!/ http-commonæRemove a header from the map. If a field with that name is not present, then this will have no effect.0 http-commonÆGiven a list of field-name,field-value pairs, construct a Headers map.2 http-common=Get the headers as a field-name,field-value association list.Æ ABCDEFG HIJKLMNO! "#$%&'()PQR*+,S-./012None Î%3 http-commonÒThe RequestBuilder monad allows you to abuse do-notation to conveniently setup a  object.4 http-commonÕRun a RequestBuilder, yielding a Request object you can use on the given connection. Š let q = buildRequest1 $ do http POST "/api/v1/messages" setContentType "application/json" setHostname "clue.example.com" 80 setAccept "text/html" setHeader "X-WhoDoneIt" "The Butler"+Obviously it's up to you to later actually send JSON data.5 http-common2Run a RequestBuilder from within a monadic action.#Older versions of this library had 5é in IO; there's no longer a need for that, but this code path will continue to work for existing users. 4 q <- buildRequest $ do http GET "/"6 http-common=Begin constructing a Request, starting with the request line.7 http-commonèSet the [virtual] hostname for the request. In ordinary conditions you won't need to call this, as the Host:ù header is a required header in HTTP 1.1 and is set directly from the name of the server you connected to when calling .8 http-commonÒSet a generic header to be sent in the HTTP request. The other methods in the RequestBuilder API are expressed in terms of this function, but we recommend you use them where offered for their stronger types.9 http-commonãIndicate the content type you are willing to receive in a reply from the server. For more complex Accept: headers, use :.: http-commonýIndicate the content types you are willing to receive in a reply from the server in order of preference. A call of the form: õ setAccept' [("text/html", 1.0), ("application/xml", 0.8), ("*/*", 0)]will result in an Accept: header value of 4text/html; q=1.0, application/xml; q=0.8, */*; q=0.0 as you would expect.; http-commonÐSet username and password credentials per the HTTP basic authentication method. 5 setAuthorizationBasic "Aladdin" "open sesame"will result in an Authorization: header value of "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==.Basic authentication does not¡ use a message digest function to encipher the password; the above string is only base-64 encoded and is thus plain-text visible to any observer on the wire and all caches and servers at the other end, making basic authentication completely insecure. A number of web services, however, use SSL to encrypt the connection that then use HTTP basic authentication to validate requests. Keep in mind in these cases the secret is still sent to the servers on the other side and passes in clear through all layers after the SSL termination. Do notÞ use basic authentication to protect secure or user-originated privacy-sensitve information.< http-commonÙSet the MIME type corresponding to the body of the request you are sending. Defaults to  "text/plain"&, so usually you need to set this if ting.= http-commonÍIf sending multipart form data (RFC 7578), you need to set the MIME type to "multipart/form-data"7 and specify the boundary separator that will be used.5This function is special: you must subsequently use ” to sequence the individual body parts. When sending the request it will separate the individual parts by the boundary value set by this function.> http-common1Specify the length of the request body, in bytes.(RFC 2616 requires that we either send a Content-Length header or use Transfer-Encoding: chunkedö. If you know the exact size ahead of time, then call this function; the body content will still be streamed out by  io-streams in more-or-less constant space.4This function is special: in a PUT or POST request,  http-streams( will assume chunked transfer-encoding unlessû you specify a content length here, in which case you need to ensure your body function writes precisely that many bytes.? http-commonÄOverride the default setting about how the entity body will be sent.3This function is special: this explicitly sets the Transfer-Encoding: header to chunkedì and will instruct the library to actually tranfer the body as a stream ("chunked transfer encoding"). See > for forcing the opposite. You reallyÊ won't need this in normal operation, but some people are control freaks.@ http-commonöSpecify that this request should set the expectation that the server needs to approve the request before you send it.4This function is special: in a PUT or POST request,  http-streamsé will wait for the server to reply with an HTTP/1.1 100 Continue status before sending the entity body. This is handled internally; you will get the real response (be it successful 2xx, client error, 4xx, or server error 5xx) in receiveResponse9. In theory, it should be 417 if the expectation failed.ÝOnly bother with this if you know the service you're talking to requires clients to send an Expect: 100-continueÝ header and will handle it properly. Most servers don't do any precondition checking, automatically send an intermediate 100 response, and then just read the body regardless, making this a bit of a no-op in most cases.3456789:;<=>?@None %/Á ! "#$%&'()*+,-./0123456789:;<=>?@Á%$354679:;#<>@?"&'()=8 *+,! -./012Ô       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWØ*http-common-0.8.3.4-4QKXORriI4a2uoXwHYy3G5Network.Http.TypesNetwork.Http.InternalNetwork.Http.ClientsetContentMultipartmultipartFormBodyNetwork.Http.RequestBuilderNetwork.Http.ConnectionopenConnectionHttpParseExceptionHeadersHttpType getHeadersContentEncodingIdentityGzipDeflateTransferEncodingNoneChunkedResponse StatusCodeBoundary ExpectModeNormalContinue EntityBodyEmptyChunkingStaticRequestMethodGETHEADPOSTPUTDELETETRACEOPTIONSCONNECTPATCH FieldName ContentTypePortHostname unBoundary emptyBoundaryrandomBoundary packBoundary getStatusCodegetStatusMessage getHeader emptyHeaders updateHeader removeHeader buildHeaders lookupHeaderretrieveHeadersRequestBuilder buildRequest1 buildRequesthttp setHostname setHeader setAccept setAccept'setAuthorizationBasicsetContentTypesetContentLengthsetTransferEncodingsetExpectContinue pStatusCode pStatusMsgpTransferEncodingpContentEncodingpContentLengthpHeadersqMethodqHostqPathqBodyqExpectqHeaders qBoundarycomposeRequestBytescomposeMultipartBytescomposeMultipartEndingcomposeResponseBytes