{"name":"gleam_http","version":"4.0.0","gleam-version-constraint":"1.0.0 <= v","modules":{"gleam/http":{"documentation":[" Functions for working with HTTP data structures in Gleam.",""," This module makes it easy to create and modify Requests and Responses, data types."," A general HTTP message type is defined that enables functions to work on both requests and responses.",""," This module does not implement a HTTP client or HTTP server, but it can be used as a base for them."],"type-aliases":{"Header":{"documentation":" A HTTP header is a key-value pair. Header keys must be all lowercase\n characters.","deprecation":null,"parameters":0,"alias":{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}}},"types":{"ContentDisposition":{"documentation":null,"deprecation":null,"parameters":0,"constructors":[{"documentation":null,"name":"ContentDisposition","parameters":[{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":"parameters","type":{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}]}}]}]},"Method":{"documentation":" HTTP standard method as defined by [RFC 2616](https://tools.ietf.org/html/rfc2616),\n and PATCH which is defined by [RFC 5789](https://tools.ietf.org/html/rfc5789).","deprecation":null,"parameters":0,"constructors":[{"documentation":null,"name":"Get","parameters":[]},{"documentation":null,"name":"Post","parameters":[]},{"documentation":null,"name":"Head","parameters":[]},{"documentation":null,"name":"Put","parameters":[]},{"documentation":null,"name":"Delete","parameters":[]},{"documentation":null,"name":"Trace","parameters":[]},{"documentation":null,"name":"Connect","parameters":[]},{"documentation":null,"name":"Options","parameters":[]},{"documentation":null,"name":"Patch","parameters":[]},{"documentation":" Non-standard but valid HTTP methods.","name":"Other","parameters":[{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}]}]},"MultipartBody":{"documentation":null,"deprecation":null,"parameters":0,"constructors":[{"documentation":" The body for the part has been fully parsed.","name":"MultipartBody","parameters":[{"label":"chunk","type":{"kind":"named","name":"BitArray","package":"","module":"gleam","parameters":[]}},{"label":"done","type":{"kind":"named","name":"Bool","package":"","module":"gleam","parameters":[]}},{"label":"remaining","type":{"kind":"named","name":"BitArray","package":"","module":"gleam","parameters":[]}}]},{"documentation":null,"name":"MoreRequiredForBody","parameters":[{"label":"chunk","type":{"kind":"named","name":"BitArray","package":"","module":"gleam","parameters":[]}},{"label":"continuation","type":{"kind":"fn","parameters":[{"kind":"named","name":"BitArray","package":"","module":"gleam","parameters":[]}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"MultipartBody","package":"gleam_http","module":"gleam/http","parameters":[]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}}}]}]},"MultipartHeaders":{"documentation":null,"deprecation":null,"parameters":0,"constructors":[{"documentation":" The headers for the part have been fully parsed.\n Header keys are all lowercase.","name":"MultipartHeaders","parameters":[{"label":"headers","type":{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}]}},{"label":"remaining","type":{"kind":"named","name":"BitArray","package":"","module":"gleam","parameters":[]}}]},{"documentation":" More input is required to parse the headers for this part.","name":"MoreRequiredForHeaders","parameters":[{"label":"continuation","type":{"kind":"fn","parameters":[{"kind":"named","name":"BitArray","package":"","module":"gleam","parameters":[]}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"MultipartHeaders","package":"gleam_http","module":"gleam/http","parameters":[]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}}}]}]},"Scheme":{"documentation":" The two URI schemes for HTTP\n","deprecation":null,"parameters":0,"constructors":[{"documentation":null,"name":"Http","parameters":[]},{"documentation":null,"name":"Https","parameters":[]}]}},"constants":{},"functions":{"method_to_string":{"documentation":null,"deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Method","package":"gleam_http","module":"gleam/http","parameters":[]}}],"return":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},"parse_content_disposition":{"documentation":null,"deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"ContentDisposition","package":"gleam_http","module":"gleam/http","parameters":[]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"parse_method":{"documentation":null,"deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"Method","package":"gleam_http","module":"gleam/http","parameters":[]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"parse_multipart_body":{"documentation":" Parse the body for part of a multipart message, as defined in RFC 2045. The\n body is everything until the next boundary. This function is generally to be\n called after calling `parse_multipart_headers` for a given part.\n\n This function will accept input of any size, it is up to the caller to limit\n it if needed.\n\n To enable streaming parsing of multipart messages, this function will return\n a continuation if there is not enough data to fully parse the body, along\n with the data that has been parsed so far. Further information is available\n in the documentation for `MultipartBody`.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"BitArray","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"MultipartBody","package":"gleam_http","module":"gleam/http","parameters":[]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"parse_multipart_headers":{"documentation":" Parse the headers for part of a multipart message, as defined in RFC 2045.\n\n This function skips any preamble before the boundary. The preamble may be\n retrieved using `parse_multipart_body`.\n\n This function will accept input of any size, it is up to the caller to limit\n it if needed.\n\n To enable streaming parsing of multipart messages, this function will return\n a continuation if there is not enough data to fully parse the headers.\n Further information is available in the documentation for `MultipartBody`.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"BitArray","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"MultipartHeaders","package":"gleam_http","module":"gleam/http","parameters":[]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"scheme_from_string":{"documentation":" Parse a HTTP scheme from a string\n\n # Examples\n\n    > scheme_from_string(\"http\")\n    Ok(Http)\n\n    > scheme_from_string(\"ftp\")\n    Error(Nil)\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"Scheme","package":"gleam_http","module":"gleam/http","parameters":[]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"scheme_to_string":{"documentation":" Convert a scheme into a string.\n\n # Examples\n\n    > scheme_to_string(Http)\n    \"http\"\n\n    > scheme_to_string(Https)\n    \"https\"\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Scheme","package":"gleam_http","module":"gleam/http","parameters":[]}}],"return":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}}},"gleam/http/cookie":{"documentation":[],"type-aliases":{},"types":{"Attributes":{"documentation":" Attributes of a cookie when sent to a client in the `set-cookie` header.","deprecation":null,"parameters":0,"constructors":[{"documentation":null,"name":"Attributes","parameters":[{"label":"max_age","type":{"kind":"named","name":"Option","package":"gleam_stdlib","module":"gleam/option","parameters":[{"kind":"named","name":"Int","package":"","module":"gleam","parameters":[]}]}},{"label":"domain","type":{"kind":"named","name":"Option","package":"gleam_stdlib","module":"gleam/option","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}},{"label":"path","type":{"kind":"named","name":"Option","package":"gleam_stdlib","module":"gleam/option","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}},{"label":"secure","type":{"kind":"named","name":"Bool","package":"","module":"gleam","parameters":[]}},{"label":"http_only","type":{"kind":"named","name":"Bool","package":"","module":"gleam","parameters":[]}},{"label":"same_site","type":{"kind":"named","name":"Option","package":"gleam_stdlib","module":"gleam/option","parameters":[{"kind":"named","name":"SameSitePolicy","package":"gleam_http","module":"gleam/http/cookie","parameters":[]}]}}]}]},"SameSitePolicy":{"documentation":" Policy options for the SameSite cookie attribute\n\n https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite","deprecation":null,"parameters":0,"constructors":[{"documentation":null,"name":"Lax","parameters":[]},{"documentation":null,"name":"Strict","parameters":[]},{"documentation":null,"name":"None","parameters":[]}]}},"constants":{},"functions":{"defaults":{"documentation":" Helper to create sensible default attributes for a set cookie.\n\n https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#Attributes","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Scheme","package":"gleam_http","module":"gleam/http","parameters":[]}}],"return":{"kind":"named","name":"Attributes","package":"gleam_http","module":"gleam/http/cookie","parameters":[]}},"parse":{"documentation":" Parse a list of cookies from a header string. Any malformed cookies will be\n discarded.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}]}},"set_header":{"documentation":null,"deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"Attributes","package":"gleam_http","module":"gleam/http/cookie","parameters":[]}}],"return":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}}},"gleam/http/request":{"documentation":[],"type-aliases":{},"types":{"Request":{"documentation":" A HTTP request.\n\n The body of the request is parameterised. The HTTP server or client you are\n using will have a particular set of types it supports for the body.\n ","deprecation":null,"parameters":1,"constructors":[{"documentation":null,"name":"Request","parameters":[{"label":"method","type":{"kind":"named","name":"Method","package":"gleam_http","module":"gleam/http","parameters":[]}},{"label":"headers","type":{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}]}},{"label":"body","type":{"kind":"variable","id":0}},{"label":"scheme","type":{"kind":"named","name":"Scheme","package":"gleam_http","module":"gleam/http","parameters":[]}},{"label":"host","type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":"port","type":{"kind":"named","name":"Option","package":"gleam_stdlib","module":"gleam/option","parameters":[{"kind":"named","name":"Int","package":"","module":"gleam","parameters":[]}]}},{"label":"path","type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":"query","type":{"kind":"named","name":"Option","package":"gleam_stdlib","module":"gleam/option","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}}]}]}},"constants":{},"functions":{"from_uri":{"documentation":" Construct a request from a URI.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Uri","package":"gleam_stdlib","module":"gleam/uri","parameters":[]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"get_cookies":{"documentation":" Fetch the cookies sent in a request.\n\n Note badly formed cookie pairs will be ignored.\n RFC6265 specifies that invalid cookie names/attributes should be ignored.","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}}],"return":{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}]}},"get_header":{"documentation":" Get the value for a given header.\n\n If the request does not have that header then `Error(Nil)` is returned.\n\n Header keys are always lowercase in `gleam_http`. To use any uppercase\n letter is invalid.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"get_query":{"documentation":" Decode the query of a request.","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"map":{"documentation":" Update the body of a request using a given function.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"fn","parameters":[{"kind":"variable","id":0}],"return":{"kind":"variable","id":1}}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":1}]}},"new":{"documentation":" A request with commonly used default values. This request can be used as\n an initial value and then update to create the desired request.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}},"path_segments":{"documentation":" Return the non-empty segments of a request path.\n\n # Examples\n\n ```gleam\n > new()\n > |> set_path(\"/one/two/three\")\n > |> path_segments\n [\"one\", \"two\", \"three\"]\n ```\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}}],"return":{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}},"prepend_header":{"documentation":" Prepend the header with the given value under the given header key.\n\n Similar to `set_header` except if the header already exists it prepends\n another header with the same key.\n\n Header keys are always lowercase in `gleam_http`. To use any uppercase\n letter is invalid.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"remove_cookie":{"documentation":" Remove a cookie from a request\n\n Remove a cookie from the request. If no cookie is found return the request unchanged.\n This will not remove the cookie from the client.","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"set_body":{"documentation":" Set the body of the request, overwriting any existing body.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"variable","id":1}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":1}]}},"set_cookie":{"documentation":" Send a cookie with a request\n\n Multiple cookies are added to the same cookie header.","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"set_header":{"documentation":" Set the header with the given value under the given header key.\n\n If already present, it is replaced.\n\n Header keys are always lowercase in `gleam_http`. To use any uppercase\n letter is invalid.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"set_host":{"documentation":" Set the host of the request.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"set_method":{"documentation":" Set the method of the request.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"Method","package":"gleam_http","module":"gleam/http","parameters":[]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"set_path":{"documentation":" Set the path of the request.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"set_port":{"documentation":" Set the port of the request.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"Int","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"set_query":{"documentation":" Set the query of the request.\n Query params will be percent encoded before being added to the Request.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"set_scheme":{"documentation":" Set the scheme (protocol) of the request.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"Scheme","package":"gleam_http","module":"gleam/http","parameters":[]}}],"return":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}},"to":{"documentation":" Construct a request from a URL string\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"to_uri":{"documentation":" Return the uri that a request was sent to.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}}],"return":{"kind":"named","name":"Uri","package":"gleam_stdlib","module":"gleam/uri","parameters":[]}}}},"gleam/http/response":{"documentation":[],"type-aliases":{},"types":{"Response":{"documentation":" A HTTP response.\n\n The body of the request is parameterised. The HTTP server or client you are\n using will have a particular set of types it supports for the body.\n ","deprecation":null,"parameters":1,"constructors":[{"documentation":null,"name":"Response","parameters":[{"label":"status","type":{"kind":"named","name":"Int","package":"","module":"gleam","parameters":[]}},{"label":"headers","type":{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}]}},{"label":"body","type":{"kind":"variable","id":0}}]}]}},"constants":{},"functions":{"expire_cookie":{"documentation":" Expire a cookie value for a client\n\n Note: The attributes value should be the same as when the response cookie was set.","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"Attributes","package":"gleam_http","module":"gleam/http/cookie","parameters":[]}}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},"get_cookies":{"documentation":" Fetch the cookies sent in a response. \n\n Badly formed cookies will be discarded.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}}],"return":{"kind":"named","name":"List","package":"","module":"gleam","parameters":[{"kind":"tuple","elements":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}]}},"get_header":{"documentation":" Get the value for a given header.\n\n If the response does not have that header then `Error(Nil)` is returned.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]},{"kind":"named","name":"Nil","package":"","module":"gleam","parameters":[]}]}},"map":{"documentation":" Update the body of a response using a given function.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"fn","parameters":[{"kind":"variable","id":0}],"return":{"kind":"variable","id":1}}}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":1}]}},"new":{"documentation":" Construct an empty Response.\n\n The body type of the returned response is `String` and could be set with a\n call to `set_body`.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Int","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}},"prepend_header":{"documentation":" Prepend the header with the given value under the given header key.\n\n Similar to `set_header` except if the header already exists it prepends\n another header with the same key.\n\n Header keys are always lowercase in `gleam_http`. To use any uppercase\n letter is invalid.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},"redirect":{"documentation":" Create a response that redirects to the given uri.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}]}},"set_body":{"documentation":" Set the body of the response, overwriting any existing body.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"variable","id":1}}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":1}]}},"set_cookie":{"documentation":" Set a cookie value for a client\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"Attributes","package":"gleam_http","module":"gleam/http/cookie","parameters":[]}}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},"set_header":{"documentation":" Set the header with the given value under the given header key.\n\n If the response already has that key, it is replaced.\n\n Header keys are always lowercase in `gleam_http`. To use any uppercase\n letter is invalid.\n","deprecation":null,"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},"try_map":{"documentation":" Update the body of a response using a given result returning function.\n\n If the given function returns an `Ok` value the body is set, if it returns\n an `Error` value then the error is returned.\n","deprecation":null,"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":0}]}},{"label":null,"type":{"kind":"fn","parameters":[{"kind":"variable","id":0}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"variable","id":1},{"kind":"variable","id":2}]}}}],"return":{"kind":"named","name":"Result","package":"","module":"gleam","parameters":[{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":1}]},{"kind":"variable","id":2}]}}}},"gleam/http/service":{"documentation":[],"type-aliases":{"Middleware":{"documentation":null,"deprecation":{"message":"Use middleware packages such as Wisp or Glen instead"},"parameters":4,"alias":{"kind":"fn","parameters":[{"kind":"fn","parameters":[{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":1}]}}],"return":{"kind":"fn","parameters":[{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":2}]}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":3}]}}}},"Service":{"documentation":null,"deprecation":{"message":"Use middleware packages such as Wisp or Glen instead"},"parameters":2,"alias":{"kind":"fn","parameters":[{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":1}]}}}},"types":{},"constants":{},"functions":{"map_response_body":{"documentation":null,"deprecation":{"message":"Use middleware packages such as Wisp or Glen instead"},"implementations":{"gleam":true,"uses-erlang-externals":false,"uses-javascript-externals":false,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"fn","parameters":[{"kind":"variable","id":0}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":1}]}}},{"label":"with","type":{"kind":"fn","parameters":[{"kind":"variable","id":1}],"return":{"kind":"variable","id":2}}}],"return":{"kind":"fn","parameters":[{"kind":"variable","id":0}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":2}]}}},"method_override":{"documentation":null,"deprecation":{"message":"Use middleware packages such as Wisp or Glen instead"},"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"fn","parameters":[{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}],"return":{"kind":"variable","id":1}}}],"return":{"kind":"fn","parameters":[{"kind":"named","name":"Request","package":"gleam_http","module":"gleam/http/request","parameters":[{"kind":"variable","id":0}]}],"return":{"kind":"variable","id":1}}},"prepend_response_header":{"documentation":null,"deprecation":{"message":"Use middleware packages such as Wisp or Glen instead"},"implementations":{"gleam":false,"uses-erlang-externals":true,"uses-javascript-externals":true,"can-run-on-erlang":true,"can-run-on-javascript":true},"parameters":[{"label":null,"type":{"kind":"fn","parameters":[{"kind":"variable","id":0}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":1}]}}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}},{"label":null,"type":{"kind":"named","name":"String","package":"","module":"gleam","parameters":[]}}],"return":{"kind":"fn","parameters":[{"kind":"variable","id":0}],"return":{"kind":"named","name":"Response","package":"gleam_http","module":"gleam/http/response","parameters":[{"kind":"variable","id":1}]}}}}}}}