def receive_request(self, transaction):
        """
        Handle request and execute the requested method

        :type transaction: Transaction
        :param transaction: the transaction that owns the request
        :rtype : Transaction
        :return: the edited transaction with the response to the request
        """
        method = transaction.request.code
        if method == defines.Codes.GET.number:
            transaction = self._handle_get(transaction)
        elif method == defines.Codes.POST.number:
            transaction = self._handle_post(transaction)
        elif method == defines.Codes.PUT.number:
            transaction = self._handle_put(transaction)
        elif method == defines.Codes.DELETE.number:
            transaction = self._handle_delete(transaction)
        else:
            transaction.response = None
        return transaction
def receive_request ( self , transaction ) : method = transaction . request . code if method == defines . Codes . GET . number : transaction = self . _handle_get ( transaction ) elif method == defines . Codes . POST . number : transaction = self . _handle_post ( transaction ) elif method == defines . Codes . PUT . number : transaction = self . _handle_put ( transaction ) elif method == defines . Codes . DELETE . number : transaction = self . _handle_delete ( transaction ) else : transaction . response = None return transaction
Handle request and execute the requested method

        :type transaction: Transaction
        :param transaction: the transaction that owns the request
        :rtype : Transaction
        :return: the edited transaction with the response to the request