Handling of HTTP requests to AWS Services.
Sends a Request to a Service without signing it.
HTTP request methods.
Request path.
Holds an unsigned AWS HTTP request.
Creates an unsigned HTTP request to an AWS service.
Holds a request body.
MIME type.
Create an empty body.
Create a body with a custom MIME type and the given string as content.
stringBody "text/html" "<html><body><h1>Hello</h1></body></html>"Create a body containing a JSON value.
This will automatically add the Content-Type: application/json header.
Appends headers to an AWS HTTP unsigned request.
See the AWS.KVEncode for encoder functions to build the headers with.
Appends query arguments to an AWS HTTP unsigned request.
See the AWS.KVEncode for encoder functions to build the query parameters with.
Decoders that interpret responses.
A full decoder for the response that can look at the status code, metadata
including headers and so on. The body is presented as a String for parsing.
It is possible to report an error as a String when interpreting the response, and
this will be mapped onto Http.BadBody when present.
A full JSON decoder for the response that can look at the status code, metadata
including headers and so on. The body is presented as a JSON Value for decoding.
Any decoder error is mapped onto Http.BadBody as a String when present using
Decode.errorToString.
A decoder for the response that uses only the body presented as a String
for parsing.
It is possible to report an error as a String when interpreting the response, and
this will be mapped onto Http.BadBody when present.
Note that this decoder is only used when the response is Http.GoodStatus_. An Http.BadStatus_ is always mapped to Http.BadStatus without attempting to decode the body. If you need to handle things that Elm HTTP regards as BadStatus_, use one of the 'full' decoders.
A decoder for the response that uses only the body presented as a JSON Value
for decoding.
Any decoder error is mapped onto Http.BadBody as a String when present using
Decode.errorToString.
Note that this decoder is only used when the response is Http.GoodStatus_. An Http.BadStatus_ is always mapped to Http.BadStatus without attempting to decode the body. If you need to handle things that Elm HTTP regards as BadStatus_, use one of the 'full' decoders.
Not all AWS service produce a response that contains useful information.
The constantDecoder is helpful in those situations and just produces whatever
value you give it once AWS has responded.
Note that this decoder is only used when the response is Http.GoodStatus_. An Http.BadStatus_ is always mapped to Http.BadStatus without attempting to decode the body. If you need to handle things that Elm HTTP regards as BadStatus_, use one of the 'full' decoders.
The HTTP calls made to AWS can produce errors in two ways. The first is the
normal Http.Error responses. The second is an error message at the application
level from one of the AWS service endpoints.
Only some endpoints can produce application level errors, in which case their error
type can be given as Never.
AWS application level errors consist of a 'type' giving the name of an 'exception' and possibly a message string.
The default decoder for the standard AWS application level errors.
Use this, or define your own decoder to interpret these errors.
The never error decoder for AWS endpoints that are not expected to produce any application level errors.
If this decoder were to be called, it will simply return the body undecoded as an error and this should be mapped onto Http.BadBody.
Signs and sends a
Requestto aService.