Exemple #1
0
    def get(self, *args, **kw):
        # self._validate_tba_app_id()
        self._errors = ValidationHelper.validate_request(self)
        if self._errors:
            self.abort(400)

        self._track_call(*args, **kw)
        super(ApiBaseController, self).get(*args, **kw)
        self.response.headers['X-TBA-Version'] = '{}'.format(self.API_VERSION)
        self.response.headers['Vary'] = 'Accept-Encoding'
    def get(self, *args, **kw):
        self._validate_tba_auth_key()
        self._errors = ValidationHelper.validate_request(self)
        if self._errors:
            self.abort(404)

        self._track_call(*args, **kw)
        super(ApiBaseController, self).get(*args, **kw)
        self.response.headers['X-TBA-Version'] = '{}'.format(self.API_VERSION)
        self.response.headers['Vary'] = 'Accept-Encoding'
    def post(self, *args, **kw):
        self._validate_tba_auth_key()
        self._errors = ValidationHelper.validate_request(self)
        if self._errors:
            self.abort(404)

        rendered = self._render(*args, **kw)
        self._track_call(*args, **kw)
        self.response.out.write(rendered)
        self.response.headers['X-TBA-Version'] = '{}'.format(self.API_VERSION)
        self.response.headers['Vary'] = 'Accept-Encoding'
    def post(self, *args, **kw):
        self._validate_tba_auth_key()
        self._errors = ValidationHelper.validate_request(self)
        if self._errors:
            self.abort(404)

        rendered = self._render(*args, **kw)
        self._track_call(*args, **kw)
        self.response.out.write(rendered)
        self.response.headers['X-TBA-Version'] = '{}'.format(self.API_VERSION)
        self.response.headers['Vary'] = 'Accept-Encoding'
    def post(self, *args, **kw):
        with TraceContext() as root:
            with root.span("ApiBaseController.post"):
                self._validate_tba_auth_key()
                self._errors = ValidationHelper.validate_request(self)
                if self._errors:
                    self.abort(404)

                rendered = self._render(*args, **kw)
                self.response.out.write(rendered)
                self.response.headers['X-TBA-Version'] = '{}'.format(self.API_VERSION)
                self.response.headers['Vary'] = 'Accept-Encoding'

                if not self._errors:
                    self._track_call(*args, **kw)
    def get(self, *args, **kw):
        with TraceContext() as root:
            with root.span("ApiBaseController.get"):
                self._validate_tba_auth_key()
                self._errors = ValidationHelper.validate_request(self)
                if self._errors:
                    self.abort(404)

                super(ApiBaseController, self).get(*args, **kw)
                self.response.headers['X-TBA-Version'] = '{}'.format(
                    self.API_VERSION)
                self.response.headers['Vary'] = 'Accept-Encoding'

        if not self._errors:
            self._track_call(*args, **kw)