MCPcopy
hub / github.com/AstrBotDevs/AstrBot / json

Method json

astrbot/api/web.py:200–212  ·  view source on GitHub ↗

Read the JSON request body. Args: default: Value returned when the request body cannot be parsed as JSON. Returns: Parsed JSON data or default.

(self, default: DefaultT | None = None)

Source from the content-addressed store, hash-verified

198 return await self._request.body()
199
200 async def json(self, default: DefaultT | None = None) -> Any | DefaultT | None:
201 """Read the JSON request body.
202
203 Args:
204 default: Value returned when the request body cannot be parsed as JSON.
205
206 Returns:
207 Parsed JSON data or default.
208 """
209 try:
210 return await self._request.json()
211 except Exception:
212 return default
213
214 async def _load_form_parts(self) -> None:
215 if self._form_cache is not None and self._files_cache is not None:

Callers 4

jsonMethod · 0.45
_query_astrbot_noticeMethod · 0.45
loadModuleMethod · 0.45
regenerateMessageFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected