Skip to main content

Module response

Module response 

Source
Expand description

SES XML response formatting and error serialization.

SES v1 responses use text/xml content type following the awsQuery protocol. SES v2 responses use application/json.

All SES v1 responses follow the pattern:

<{Operation}Response xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <{Operation}Result>
    ...fields...
  </{Operation}Result>
  <ResponseMetadata>
    <RequestId>{uuid}</RequestId>
  </ResponseMetadata>
</{Operation}Response>

Structs§

XmlWriter
Simple XML writer for building SES response XML.

Constants§

JSON_CONTENT_TYPE
Content type for SES v2 JSON responses.
XML_CONTENT_TYPE
Content type for SES v1 XML responses.

Functions§

error_to_json_response
Convert an SesError into a JSON error response (for v2).
error_to_response
Convert an SesError into a complete HTTP error response (XML for v1).
error_to_xml
Serialize an SES error into an XML error response body string.
json_response
Build a success JSON response for SES v2.
xml_escape
XML-escape a string value.
xml_response
Build a success XML response with the given body and request ID.