align implementation for encode-response, send-entity-body, and send-headers