Helpers for working with DNN Web API
When a request fails, the Failure value will be one of these. Most of these are copied from Http.Error in the elm/http module.
When there is a BadStatus, both the status code and the body of the response are included. This allows getErrorMessage to retrieve any error message in the response, if they are available.
HTTP GET
HTTP POST
HTTP PATCH
HTTP PUT
HTTP DELETE
Raw request that expects a JSON response.
This version can use any method and accepts any body (e.g. Http.fileBody, Http.bytesBody, or Http.emptyBody).
Raw request that expects a String response (but not necessarily a valid JSON String).
This version can use any method and accepts any body (e.g. Http.fileBody, Http.bytesBody, or Http.emptyBody).
Additionally, instead of providing a Json.Decode.Decoder to handle the response, you provide a function which can
transform the String response body (and response metadata) however you need.
Get the localized error message from the Error
Json decoder for Config
JSON decoder for server error, localized.
The error comes from a string field named "ExceptionMessage", "exceptionMessage", "Message", "message", or otherwise multipleServerErrorDecoder.
JSON decoder for multiple server error messages, localized.
The messages come from a string array field named "ExceptionMessage", "exceptionMessage", "Messages", or "message". These values are then concatenated with spaces.
Null decoder. Useful for when the server doesn't return any value.
Configuration type
baseUrlthe base URL for the HTTP requestsheaders: list of the headers for the HTTP requests