home / docs / sections

Menu

sections: internals:internals-datasette-client-actor

This data as json

id page ref title content breadcrumbs references
internals:internals-datasette-client-actor internals internals-datasette-client-actor Authenticating as an actor All datasette.client methods accept an optional actor= parameter. When set to a dictionary describing an actor, the request is made with a signed ds_actor cookie identifying that actor — as if the request had been made by a user who is signed in as that actor. This is a convenient shorthand equivalent to signing the cookie manually using datasette.client.actor_cookie() . Example usage: response = await datasette.client.get( "/-/actor.json", actor={"id": "root"} ) assert response.json() == {"actor": {"id": "root"}} This parameter works with all HTTP methods ( get , post , put , patch , delete , options , head ) and the generic request method. Passing both actor= and a ds_actor cookie via cookies= raises a TypeError . Other unrelated cookies can be combined with actor= . ["Internals for plugins", "Datasette class", "datasette.client"] []
Powered by Datasette · Queries took 4.214ms