úÎytØ8      !"#$%&'()*+,-./01234567None The map of headers in a  or  . Note that HTTP 9 header field names are case insensitive, so if you call  setHeader  on a field that'6s already defined but with a different capitalization & you will replace the existing value. BAccessors common to both the outbound and return sides of an HTTP  connection. DGet the Headers from a Request or Response. Most people do not need D 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.Typeswill give you functions like * and ' to to  work with. =A description of the response received from the server. Note 3 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 E the status line and response headers as they were received from the  server. CA description of the request that will be sent to the server. Note 2 unlike other HTTP libraries, the request body is not a part of this D 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 A line and headers (as it will be sent over the wire but with the \r 8 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 Methods, as per RFC 2616 ##Get the HTTP response status code. $@Get the HTTP response status message. Keep in mind that this is  not normative; whereas # values are authoritative. %=Lookup a header in the response. HTTP header field names are E case-insensitive, so you can specify the name to lookup however you $ like. If the header is not present Nothing will be returned.  2 let n = case getHeader p "Content-Length" of * Just x' -> read x' :: Int  Nothing -> 0 Kwhich of course is essentially what goes on inside the client library when M it receives a response from the server and has to figure out how many bytes  to read. EThere is a fair bit of complexity in some of the other HTTP response D fields, so there are a number of specialized functions for reading  those values where we've found them useful. '?Set a header field to the specified value. This will overwrite C any existing value for the field. Remember that HTTP fields names  are case insensitive! (HRemove a header from the map. If a field with that name is not present,  then this will have no effect. )GGiven a list of field-name,field-value pairs, construct a Headers map. +>Get the headers as a field-name,field-value association list. K89 :;<=>?@ ABCDEFG !"HIJ#$%KLM&'()N*+OPQRSTUV< :;<=>?@ ABCDEFG !"H#$%K&'()*+%89  :;<=>?@ ABCDEFG !"HIJ#$%KLM&'()N*+OPQRSTUVNone -<The RequestBuilder monad allows you to abuse do-notation to  conveniently setup a  object. .CRun a RequestBuilder, yielding a Request object you can use on the  given connection.   q <- buildRequest $ 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. />Begin constructing a Request, starting with the request line. 0Set the [virtual]2 hostname for the request. In ordinary conditions  you won't need to call this, as the Host: header is a required D header in HTTP 1.1 and is set directly from the name of the server  you connected to when calling . 1?Set a generic header to be sent in the HTTP request. The other B methods in the RequestBuilder API are expressed in terms of this A function, but we recommend you use them where offered for their  stronger types. 2@Indicate the content type you are willing to receive in a reply # from the server. For more complex Accept: headers, use  3. 3AIndicate 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  text/html; q=1.0, application/ xml; q=0.8, */*; q=0.0 as you  would expect. 49Set username and password credentials per the HTTP basic  authentication method.  7 setAuthorizationBasic "Aladdin" "open sesame" will result in an Authorization: header value of  "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==. Basic authentication does not" use a message digest function to E 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 B caches and servers at the other end, making basic authentication D completely insecure. A number of web services, however, use SSL to C encrypt the connection that then use HTTP basic authentication to D validate requests. Keep in mind in these cases the secret is still C sent to the servers on the other side and passes in clear through * all layers after the SSL termination. Do not use basic F authentication to protect secure or user-originated privacy-sensitve  information. 5CSet 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. 62Specify 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 B 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 B length here, in which case you need to ensure your body function # writes precisely that many bytes. 7>Specify that this request should set the expectation that the 9 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 D status before sending the entity body. This is handled internally; E you will get the real response (be it successful 2xx, client error,  4xx, or server error 5xx) in receiveResponse. In theory, it * should be 417 if the expectation failed. 1Only 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, E automatically send an intermediate 100 response, and then just read B the body regardless, making this a bit of a no-op in most cases. ,-W./01XYZ234567 ,-./01234567,-W./01XYZ234567None8  !"#$%&'()*+,-./012345678"!-./0234,5671 #$% &'()*+[      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX1YZ[\http-common-0.7.0.1Network.Http.TypesNetwork.Http.InternalNetwork.Http.RequestBuilderNetwork.Http.ConnectionopenConnectionHttpParseExceptionHeadersHttpType getHeadersContentEncodingDeflateGzipIdentityTransferEncodingChunkedNoneResponse StatusCode ExpectModeContinueNormal EntityBodyStaticChunkingEmptyRequestMethodPATCHCONNECTOPTIONSTRACEDELETEPUTPOSTHEADGETPortHostname getStatusCodegetStatusMessage getHeader emptyHeaders updateHeader removeHeader buildHeaders lookupHeaderretrieveHeaders ContentTypeRequestBuilder buildRequesthttp setHostname setHeader setAccept setAccept'setAuthorizationBasicsetContentTypesetContentLengthsetExpectContinueWrapunWrap pStatusCode pStatusMsgpTransferEncodingpContentEncodingpContentLengthpHeadersqMethodqHostqPathqBodyqExpectqHeaderscomposeRequestBytescrlfspcomposeResponseBytes joinHeaderscombine addHeaderdown$fExceptionHttpParseException $fShowHeaders$fHttpTypeResponse$fHttpTypeRequest$fShowResponse $fShowRequest $fEqMethod deleteHeader setEntityBody setExpectMode