ymtszw / elm-http-xml / Http.Xml

Generates HTTP request for XML API.

Using Xml.Decode for decoding XML response into Elm value.

Request Body

xmlBody : String -> Http.Body

Put an XML string in the body. Adding Content-type: application/xml header.

Note: Currently elm-xml-decode package DOES NOT provide XML "encode" functions, nor elm-xml-parser. Contributions are welcomed!

Response Expectation

expectXml : (Result Http.Error a -> msg) -> Xml.Decode.Decoder a -> Http.Expect msg

Expect the response body to be XML.

You provide Xml.Decode.Decoder to decode that XML into Elm value.

Note: Currently, Expect type does not come with content-negotiation capability using Accept header. So if your target APIs require Accept: application/xml headers, you have to insert them using Http.request.

See this issue: https://github.com/elm/http/issues/54