sections_fts: 89
This data as json
| rowid | title | content |
|---|---|---|
| 89 | Detecting internal client requests | datasette.in_client() - returns bool Returns True if the current code is executing within a datasette.client request, False otherwise. This method is useful for plugins that need to behave differently when called through datasette.client versus when handling external HTTP requests. Example usage: async def fetch_documents(datasette): if not datasette.in_client(): return Response.text( "Only available via internal client requests", status=403, ) ... Note that datasette.in_client() is independent of skip_permission_checks . A request made through datasette.client will always have in_client() return True , regardless of whether skip_permission_checks is set. |