[{"name":"HttpBuilder","comment":" Extra helpers for more easily building Http requests that require greater\nconfiguration than what is provided by `elm-http` out of the box.\n\n\n# Start a request\n\n@docs RequestBuilder, get, post, put, patch, delete, options, trace, head\n\n\n# Configure request properties\n\n@docs withHeader, withHeaders, withBody, withStringBody, withJsonBody\n@docs withMultipartStringBody, withUrlEncodedBody, withTimeout, withCredentials\n@docs withQueryParam, withQueryParams, withExpect, withCacheBuster, withExpectJson\n@docs withExpectString, withBearerToken\n\n\n# Make the request\n\n@docs toRequest, toTask, send\n\n\n# Retreive data about the request\n\n@docs requestUrl\n\n","unions":[],"aliases":[{"name":"RequestBuilder","comment":" A type for chaining request configuration\n","args":["a"],"type":"{ method : String.String, headers : List.List Http.Header, url : String.String, body : Http.Body, expect : Http.Expect a, timeout : Maybe.Maybe Basics.Float, withCredentials : Basics.Bool, queryParams : List.List ( String.String, String.String ), cacheBuster : Maybe.Maybe String.String }"}],"values":[{"name":"delete","comment":" Start building a DELETE request with a given URL\n\n    delete \"https://example.com/api/items/1\"\n\n","type":"String.String -> HttpBuilder.RequestBuilder ()"},{"name":"get","comment":" Start building a GET request with a given URL\n\n    get \"https://example.com/api/items/1\"\n\n","type":"String.String -> HttpBuilder.RequestBuilder ()"},{"name":"head","comment":" Start building a HEAD request with a given URL\n\n    head \"https://example.com/api/items/1\"\n\n","type":"String.String -> HttpBuilder.RequestBuilder ()"},{"name":"options","comment":" Start building a OPTIONS request with a given URL\n\n    options \"https://example.com/api/items/1\"\n\n","type":"String.String -> HttpBuilder.RequestBuilder ()"},{"name":"patch","comment":" Start building a PATCH request with a given URL\n\n    patch \"https://example.com/api/items/1\"\n\n","type":"String.String -> HttpBuilder.RequestBuilder ()"},{"name":"post","comment":" Start building a POST request with a given URL\n\n    post \"https://example.com/api/items\"\n\n","type":"String.String -> HttpBuilder.RequestBuilder ()"},{"name":"put","comment":" Start building a PUT request with a given URL\n\n    put \"https://example.com/api/items/1\"\n\n","type":"String.String -> HttpBuilder.RequestBuilder ()"},{"name":"requestUrl","comment":" Convert the RequestBuilder to a string representation of the URL\nwith all options applied.\n","type":"HttpBuilder.RequestBuilder a -> String.String"},{"name":"send","comment":" Send the request\n","type":"(Result.Result Http.Error a -> msg) -> HttpBuilder.RequestBuilder a -> Platform.Cmd.Cmd msg"},{"name":"toRequest","comment":" Extract the Http.Request component of the builder in case you want to use it\ndirectly. **This function is lossy** and will discard some of the extra stuff\nthat HttpBuilder allows you to do.\n\nThings that will be lost:\n\n  - Attaching a cache buster to requests using `withCacheBuster`\n\n","type":"HttpBuilder.RequestBuilder a -> Http.Request a"},{"name":"toTask","comment":" Convert the RequestBuilder to a Task with all options applied. `toTask`\ndiffers from `toRequest` in that it retains all extra behavior allowed by\nHttpBuilder, including\n\n  - Attaching a cache buster to requests using `withCacheBuster`\n\n","type":"HttpBuilder.RequestBuilder a -> Task.Task Http.Error a"},{"name":"trace","comment":" Start building a TRACE request with a given URL\n\n    trace \"https://example.com/api/items/1\"\n\n","type":"String.String -> HttpBuilder.RequestBuilder ()"},{"name":"withBearerToken","comment":" Add a bearer token to a request\n\n    get \"https://example.com/api/items/1\"\n        |> withBearerToken \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhIjoiYSJ9.MvhYYpYBuN1rUaV0GGnQGvr889zY0xSc20Lnt8nMTfE\"\n\n","type":"String.String -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withBody","comment":" Add an Http.Body to the request\n\n    post \"https://example.com/api/save-text\"\n        |> withBody (Http.stringBody \"text/plain\" \"Hello!\")\n\n","type":"Http.Body -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withCacheBuster","comment":" Send the request with a Time based cache buster added to the URL.\nYou provide a key for an extra query param, and when the request is sent that\nquery param will be given a value with the current timestamp.\n\n    type Msg\n        = Items (Result Http.Error String)\n\n    get \"https://example.com/api/items\"\n        |> withExpect (Http.expectString)\n        |> withCacheBuster \"cache_buster\"\n        |> send Items\n\n    -- makes a request to https://example.com/api/items?cache_buster=1481633217383\n\n","type":"String.String -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withCredentials","comment":" Set the `withCredentials` flag on the request to True. Works via\n[`XMLHttpRequest#withCredentials`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials)\n\n    get \"https://example.com/api/items/1\"\n        |> withCredentials\n\n","type":"HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withExpect","comment":" Choose an `Expect` for the request\n\n    get \"https://example.com/api/items/1\"\n        |> withExpect (Http.expectJson itemsDecoder)\n\n","type":"Http.Expect b -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder b"},{"name":"withExpectJson","comment":" Choose a Json `Expect` for the request\n\n    get \"https://example.com/api/items/1\"\n        |> withExpectJson itemsDecoder\n\n","type":"Json.Decode.Decoder b -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder b"},{"name":"withExpectString","comment":" Choose a String `Expect` for the request\n\n    get \"https://example.com/api/items/1\"\n        |> withExpectString\n\n","type":"HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder String.String"},{"name":"withHeader","comment":" Add a single header to a request\n\n    get \"https://example.com/api/items/1\"\n        |> withHeader \"Content-Type\" \"application/json\"\n\n","type":"String.String -> String.String -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withHeaders","comment":" Add many headers to a request\n\n    get \"https://example.com/api/items/1\"\n        |> withHeaders [(\"Content-Type\", \"application/json\"), (\"Accept\", \"application/json\")]\n\n","type":"List.List ( String.String, String.String ) -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withJsonBody","comment":" Convenience function for adding a JSON body to a request\n\n    params = Json.Encode.object\n        [ (\"sortBy\", Json.Encode.string \"coolness\")\n        , (\"take\", Json.Encode.int 10)\n        ]\n\n    post \"https://example.com/api/items/1\"\n        |> withJsonBody params\n\n","type":"Json.Encode.Value -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withMultipartStringBody","comment":" Convenience function for adding multipart bodies composed of String, String\nkey-value pairs. Since `Http.stringData` is currently the only `Http.Data`\ncreator having this function removes the need to use the `Http.Data` type in\nyour type signatures.\n\n    post \"https://example.com/api/items/1\"\n        |> withMultipartStringBody [(\"user\", JS.encode user)]\n\n","type":"List.List ( String.String, String.String ) -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withQueryParam","comment":" Add a query param to the url for the request\n\n    get \"https://example.com/api/items/1\"\n        |> withQueryParam \"hello\" \"world\"\n    -- sends a request to https://example.com/api/items/1?hello=world\n\n","type":"String.String -> String.String -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withQueryParams","comment":" Add some query params to the url for the request\n\n    get \"https://example.com/api/items/1\"\n        |> withQueryParams [(\"hello\", \"world\"), (\"foo\", \"bar\")]\n        |> withQueryParams [(\"baz\", \"qux\")]\n    -- sends a request to https://example.com/api/items/1?hello=world&foo=bar&baz=qux\n\n","type":"List.List ( String.String, String.String ) -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withStringBody","comment":" Convenience function for adding a string body to a request\n\n    post \"https://example.com/api/items/1\"\n        |> withStringBody \"application/json\" \"\"\"{ \"sortBy\": \"coolness\", \"take\": 10 }\"\"\"\n\n","type":"String.String -> String.String -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withTimeout","comment":" Set the `timeout` setting on the request\n\n    get \"https://example.com/api/items/1\"\n        |> withTimeout (10 * Time.second)\n\n","type":"Basics.Float -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"},{"name":"withUrlEncodedBody","comment":" Convenience function for adding url encoded bodies\n\n    post \"https://example.com/api/whatever\"\n        |> withUrlEncodedBody [(\"user\", \"Luke\"), (\"pwd\", \"secret\")]\n\n","type":"List.List ( String.String, String.String ) -> HttpBuilder.RequestBuilder a -> HttpBuilder.RequestBuilder a"}],"binops":[]}]