[
    {
        "name": "Http",
        "comment": "\n\n# Encoding and Decoding\n@docs url, uriEncode, uriDecode\n\n# Fetch Strings and JSON\n@docs getString, get, post, Error\n\n# Body Values\n@docs empty, string, multipart, stringData\n\n# Arbitrary Requests\n@docs send, Request, Settings, defaultSettings\n\n# Responses\n@docs Response, Value, fromJson, RawError",
        "unions": [
            {
                "name": "Error",
                "comment": "The kinds of errors you typically want in practice. When you get a\nresponse but its status is not in the 200 range, it will trigger a\n`BadResponse`. When you try to decode JSON but something goes wrong,\nyou will get an `UnexpectedPayload`.",
                "args": [],
                "cases": [
                    [
                        "Timeout",
                        []
                    ],
                    [
                        "NetworkError",
                        []
                    ],
                    [
                        "UnexpectedPayload",
                        [
                            "String"
                        ]
                    ],
                    [
                        "BadResponse",
                        [
                            "Int",
                            "String"
                        ]
                    ]
                ]
            },
            {
                "name": "RawError",
                "comment": "The things that count as errors at the lowest level. Technically, getting\na response back with status 404 is a &ldquo;successful&rdquo; response in that\nyou actually got all the information you asked for.\n\nThe `fromJson` function and `Error` type provide higher-level errors, but the\npoint of `RawError` is to allow you to define higher-level errors however you\nwant.",
                "args": [],
                "cases": [
                    [
                        "RawTimeout",
                        []
                    ],
                    [
                        "RawNetworkError",
                        []
                    ]
                ]
            },
            {
                "name": "Value",
                "comment": "The information given in the response. Currently there is no way to handle\n`Blob` types since we do not have an Elm API for that yet. This type will\nexpand as more values become available in Elm itself.",
                "args": [],
                "cases": [
                    [
                        "Text",
                        [
                            "String"
                        ]
                    ],
                    [
                        "Blob",
                        [
                            "Blob"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [
            {
                "name": "Request",
                "comment": "Fully specify the request you want to send. For example, if you want to\nsend a request between domains (CORS request) you will need to specify some\nheaders manually.\n\n    corsPost : Request\n    corsPost =\n        { verb = \"POST\"\n        , headers =\n            [ (\"Origin\", \"http://elm-lang.org\")\n            , (\"Access-Control-Request-Method\", \"POST\")\n            , (\"Access-Control-Request-Headers\", \"X-Custom-Header\")\n            ]\n        , url = \"http://example.com/hats\"\n        , body = empty\n        }",
                "args": [],
                "type": "{ verb : String, headers : List ( String, String ), url : String, body : Body }"
            },
            {
                "name": "Response",
                "comment": "All the details of the response. There are many weird facts about\nresponses which include:\n\n  * The `status` may be 0 in the case that you load something from `file://`\n  * You cannot handle redirects yourself, they will all be followed\n    automatically. If you want to know if you have gone through one or more\n    redirect, the `url` field will let you know who sent you the response, so\n    you will know if it does not match the URL you requested.\n  * You are allowed to have duplicate headers, and their values will be\n    combined into a single comma-separated string.\n\nWe have left these underlying facts about `XMLHttpRequest` as is because one\ngoal of this library is to give a low-level enough API that others can build\nwhatever helpful behavior they want on top of it.",
                "args": [],
                "type": "{ status : Int, statusText : String, headers : Dict String String, url : String, value : Value }"
            },
            {
                "name": "Settings",
                "comment": "Configure your request if you need specific behavior.\n\n  * `timeout` lets you specify how long you are willing to wait for a response\n    before giving up. By default it is 0 which means &ldquo;never give\n    up!&rdquo;\n\n  * `onStart` and `onProgress` allow you to monitor progress. This is useful\n    if you want to show a progress bar when uploading a large amount of data.\n\n  * `desiredResponseType` lets you override the MIME type of the response, so\n    you can influence what kind of `Value` you get in the `Response`.",
                "args": [],
                "type": "{ timeout : Time, onStart : Maybe (Task () ()), onProgress : Maybe (Maybe { loaded : Int, total : Int } -> Task () ()), desiredResponseType : Maybe String }"
            }
        ],
        "values": [
            {
                "name": "blobData",
                "comment": "A named chunk of blob data. You provide a name for this piece of data,\nan optional file name for where the data came from, and the blob itself. If\nno file name is given, it will default to `\"blob\"`.\n\nCurrently the only way to obtain a `Blob` is in a `Response` but support will\nexpand once we have an API for blobs in Elm.",
                "type": "String -> Maybe String -> Blob -> Data"
            },
            {
                "name": "defaultSettings",
                "comment": "The default settings used by `get` and `post`.\n\n    { timeout = 0\n    , onStart = Nothing\n    , onProgress = Nothing\n    , desiredResponseType = Nothing\n    }",
                "type": "Settings"
            },
            {
                "name": "empty",
                "comment": "An empty request body, no value will be sent along.",
                "type": "Body"
            },
            {
                "name": "fromJson",
                "comment": "Turn a `Response` into an Elm value that is easier to deal with. Helpful\nif you are making customized HTTP requests with `send`, as is the case with\n`get` and `post`.\n\nGiven a `Response` this function will:\n\n  * Check that the status code is in the 200 range.\n  * Make sure the response `Value` is a string.\n  * Convert the string to Elm with the given `Decoder`.\n\nAssuming all these steps succeed, you will get an Elm value as the result!",
                "type": "Decoder a -> Task RawError Response -> Task Error a"
            },
            {
                "name": "get",
                "comment": "Send a GET request to the given URL. You also specify how to decode the\nresponse.\n\n    import Json.Decode (list, string)\n\n    hats : Task Error (List String)\n    hats =\n        get (list string) \"http://example.com/hat-categories.json\"",
                "type": "Decoder value -> String -> Task Error value"
            },
            {
                "name": "getString",
                "comment": "Send a GET request to the given URL. You will get the entire response as a\nstring.\n\n    hats : Task Error String\n    hats =\n        getString \"http://example.com/hat-categories.markdown\"",
                "type": "String -> Task Error String"
            },
            {
                "name": "multipart",
                "comment": "Create multi-part request bodies, allowing you to send many chunks of data\nall in one request. All chunks of data must be given a name.\n\nCurrently, you can only construct `stringData`, but we will support `blobData`\nand `fileData` once we have proper APIs for those types of data in Elm.",
                "type": "List Data -> Body"
            },
            {
                "name": "post",
                "comment": "Send a POST send to the given URL, carrying the given string as the body.\nYou also specify how to decode the response.\n\n    import Json.Decode (list, string)\n\n    hats : Task Error (List String)\n    hats =\n        post (list string) \"http://example.com/hat-categories.json\" empty",
                "type": "Decoder value -> String -> Body -> Task Error value"
            },
            {
                "name": "send",
                "comment": "Send a request exactly how you want it. The `Settings` argument lets you\nconfigure things like timeouts and progress monitoring. The `Request` argument\ndefines all the information that will actually be sent along to a server.\n\n    crossOriginGet : String -> String -> Task Error Response\n    crossOriginGet origin url =\n      send defaultSettings\n        { verb = \"GET\"\n        , headers = [(\"Origin\", origin)]\n        , url = url\n        , body = empty\n        }",
                "type": "Settings -> Request -> Task RawError Response"
            },
            {
                "name": "string",
                "comment": "Provide a string as the body of the request. Useful if you need to send\nJSON data to a server that does not belong in the URL.\n\n    import Json.Decode as JS\n\n    coolestHats : Task Error (List String)\n    coolestHats =\n        post\n          (JS.list JS.string)\n          \"http://example.com/hats\"\n          (string \"\"\"{ \"sortBy\": \"coolness\", \"take\": 10 }\"\"\")",
                "type": "String -> Body"
            },
            {
                "name": "stringData",
                "comment": "A named chunk of string data.\n\n    import Json.Encode as JS\n\n    body =\n      multipart\n        [ stringData \"user\" (JS.encode user)\n        , stringData \"payload\" (JS.encode payload)\n        ]",
                "type": "String -> String -> Data"
            },
            {
                "name": "uriDecode",
                "comment": "Decode a URI string. Same behavior as JavaScript's `decodeURIComponent`\nfunction.",
                "type": "String -> String"
            },
            {
                "name": "uriEncode",
                "comment": "Encode a string to be placed in any part of a URI. Same behavior as\nJavaScript's `encodeURIComponent` function.",
                "type": "String -> String"
            },
            {
                "name": "url",
                "comment": "Create a properly encoded URL. First argument is the domain, which is\nassumed to be properly encoded already. The second is a list of all the\nkey/value pairs needed for the [query string][qs]. Both the keys and values\nwill be appropriately encoded, so they can contain spaces, ampersands, etc.\n\n[qs]: http://en.wikipedia.org/wiki/Query_string\n\n    url \"http://example.com/users\" [ (\"name\", \"john doe\"), (\"age\", \"30\") ]\n    -- http://example.com/users?name=john+doe&age=30",
                "type": "String -> List ( String, String ) -> String"
            }
        ],
        "binops": []
    }
]