'Called on PUT /send/<transaction_id>/
Args:
request (twisted.web.http.Request): The HTTP request.
transaction_id (str): The transaction_id associated with this
request. This is *not* None.
Returns:
Deferred: Results in a tuple of `(code, response)`, where
`response` is a python dict to be converted into JSON that is
used as the response body.'

@defer.inlineCallbacks
def on_PUT(self, origin, content, query, transaction_id):

    try:
        transaction_data = content
        logger.debug('Decoded    %s:    %s', transaction_id, str(transaction_data))
        logger.info('Received    txn    %s    from    %s.    (PDUs:    %d,    EDUs:    %d,    failures:    %d)', transaction_id, origin, len(transaction_data.get('pdus', [])), len(transaction_data.get('edus', [])), len(transaction_data.get('failures', [])))
        transaction_data.update(transaction_id=transaction_id, destination=self.server_name)
    except Exception as e:
        logger.exception(e)
        defer.returnValue((400, {'error': 'Invalid    transaction'}))
        return
    try:
        (code, response) = (yield self.handler.on_incoming_transaction(transaction_data))
    except:
        logger.exception('on_incoming_transaction    failed')
        raise
    defer.returnValue((code, response))
