MCPcopy Create free account
hub / github.com/EasyIME/PIME / set_status

Method set_status

python/python3/tornado/web.py:349–366  ·  view source on GitHub ↗

Sets the status code for our response. :arg int status_code: Response status code. :arg str reason: Human-readable reason phrase describing the status code. If ``None``, it will be filled in from `http.client.responses` or "Unknown". .. versionchange

(self, status_code: int, reason: Optional[str] = None)

Source from the content-addressed store, hash-verified

347 pass
348
349 def set_status(self, status_code: int, reason: Optional[str] = None) -> None:
350 """Sets the status code for our response.
351
352 :arg int status_code: Response status code.
353 :arg str reason: Human-readable reason phrase describing the status
354 code. If ``None``, it will be filled in from
355 `http.client.responses` or "Unknown".
356
357 .. versionchanged:: 5.0
358
359 No longer validates that the response code is in
360 `http.client.responses`.
361 """
362 self._status_code = status_code
363 if reason is not None:
364 self._reason = escape.native_str(reason)
365 else:
366 self._reason = httputil.responses.get(status_code, "Unknown")
367
368 def get_status(self) -> int:
369 """Returns the status code for our response."""

Callers 15

redirectMethod · 0.95
finishMethod · 0.95
send_errorMethod · 0.95
initializeMethod · 0.80
getMethod · 0.80
getMethod · 0.80
accept_connectionMethod · 0.80
_accept_connectionMethod · 0.80
getMethod · 0.80
getMethod · 0.80
getMethod · 0.80
getMethod · 0.80

Calls 1

getMethod · 0.45

Tested by 15

getMethod · 0.64
getMethod · 0.64
getMethod · 0.64
getMethod · 0.64
getMethod · 0.64
prepareMethod · 0.64
getMethod · 0.64
getMethod · 0.64
getMethod · 0.64
write_errorMethod · 0.64
getMethod · 0.64
getMethod · 0.64