Extract payload from request.

def extract_payload(self):
        """Extract payload from request."""
        if not self.check_signature():
            raise InvalidSignature('Invalid Signature')
        if request.is_json:
            # Request.get_json() could be first called with silent=True.
            delete_cached_json_for(request)
            return request.get_json(silent=False, cache=False)
        elif request.content_type == 'application/x-www-form-urlencoded':
            return dict(request.form)
        raise InvalidPayload(request.content_type)