[{"name":"Ext.Http","comment":" This module extends the `Http` module with better error handling and more information in the success case.\n\n@docs Error, TaskInput, errorString, Data, identityResolver, jsonResolver\n\n","unions":[{"name":"Error","comment":" Use Ext.Http.Error instead of Http.Error to get more information about the error.\n","args":["a"],"cases":[["BadUrl",["String.String"]],["Timeout",[]],["NetworkError",[]],["BadStatus",["Http.Metadata","a"]],["BadJson",["Http.Metadata","a","Json.Decode.Error"]]]}],"aliases":[{"name":"Data","comment":" When http succeeds, you get a `Data` record with both the `Http.Metadata` and the `data` that was decoded from the response.\n\n    Http.task request\n        |> Task.andThen\n            (\\{ meta, data } ->\n                -- do something with meta and/or data\n                -- like checking the status code\n            )\n\n","args":["a"],"type":"{ meta : Http.Metadata, data : a }"},{"name":"TaskInput","comment":" Named type alias for the `Http.task` parameter\n","args":["x","a"],"type":"{ method : String.String, headers : List.List Http.Header, url : String.String, body : Http.Body, resolver : Http.Resolver x a, timeout : Maybe.Maybe Basics.Float }"}],"values":[{"name":"errorString","comment":" Convenience function to convert an Ext.Http.Error to a String.\n","type":"Ext.Http.Error String.String -> String.String"},{"name":"identityResolver","comment":" Useful for non-json payloads like Bytes or String\n\nA resolver that does not process the response at all. It just returns the response as-is, but with `Http.Metadata` included. And with error type as `Ext.Http.Error` instead of `Http.Error`.\n\n","type":"Http.Response a -> Result.Result (Ext.Http.Error a) (Ext.Http.Data a)"},{"name":"jsonResolver","comment":" Resolver for `Http.task` that includes proper details in both the error case and metadata in the success case.\n\nUsually metadata is not needed in the success case, just add `Task.map .data` to your existing code\n\n    ```diff\n     Http.task\n         { method = \"GET\"\n         , headers = []\n         , url = \"https://example.com\"\n         , body = Http.emptyBody\n    -    , resolver = Http.stringResolver (otherJsonResolver myDecoder)\n    +    , resolver = Http.stringResolver (Ext.Http.jsonResolver myDecoder)\n         , timeout = Nothing\n         }\n    +    |> Task.map .data\n    ```\n\nBut when you need it, having the metadata available is very useful.\n\n    ```diff\n     Http.task\n         { method = \"GET\"\n         , headers = []\n         , url = \"https://example.com\"\n         , body = Http.emptyBody\n         , resolver = Http.stringResolver (Ext.Http.jsonResolver myDecoder)\n         , timeout = Nothing\n         }\n    +    |> Task.map (Debug.log \"{ meta, data }\")\n         |> Task.map .data\n    ```\n\n","type":"Json.Decode.Decoder a -> Http.Response String.String -> Result.Result (Ext.Http.Error String.String) (Ext.Http.Data a)"}],"binops":[]},{"name":"Ext.Http.Cookie","comment":"\n\n@docs Attribute, Input, get, responseString\n\n","unions":[{"name":"Attribute","comment":" See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies>\n\nBut in general, don't use `Expires` anymore,\n\n    [ SameSite \"Lax\"\n    , Path \"/\"\n    , Domain \"example.com\"\n    , MaxAge 86400\n    , Secure\n    , HttpOnly\n    ]\n\n","args":[],"cases":[["SameSite",["String.String"]],["Path",["String.String"]],["Domain",["String.String"]],["MaxAge",["Basics.Int"]],["Expires",["String.String"]],["Secure",[]],["HttpOnly",[]]]}],"aliases":[{"name":"Input","comment":" See <https://datatracker.ietf.org/doc/html/rfc6265> for valid characters in cookie names and values\n","args":[],"type":"{ name : String.String, value : String.String, attributes : List.List Ext.Http.Cookie.Attribute }"}],"values":[{"name":"get","comment":" Obtains the cookie value for a given cookie name from a `Cookie` http request header\n\nNOTE: the `Cookie` http request header that server sees does not come with the attributes you see in the `Set-Cookie` response header.\n\n    requestString : String\n    requestString =\n        \"somekey=somevalue; sess=somejwt\"\n\n    get \"sess\" requestString\n    --> Just \"somejwt\"\n\n    get \"somekey\" requestString\n    --> Just \"somevalue\"\n\n","type":"String.String -> String.String -> Maybe.Maybe String.String"},{"name":"responseString","comment":" Return a String value that can be used as the value of a `Set-Cookie` response header\n\n    Http.header \"Set-Cookie\" (responseString Input)\n\nThe generated String will be in the format:\n\n    responseString\n        { name = \"somekey\"\n        , value = \"somevalue\"\n        , attributes =\n            [ SameSite \"Lax\"\n            , Path \"/\"\n            , Domain \"example.com\"\n            , MaxAge 86400\n            , Expires \"Wed, 21 Oct 2015 07:28:00 GMT\"\n            , Secure\n            , HttpOnly\n            ]\n        }\n    --> \"somekey=somevalue; SameSite=Lax; Path=/; Domain=example.com; Max-Age=86400; Expires=Wed, 21 Oct 2015 07:28:00 GMT; Secure; HttpOnly\"\n\n","type":"Ext.Http.Cookie.Input -> String.String"}],"binops":[]}]