mirror of
https://github.com/simonw/datasette.git
synced 2026-06-04 08:07:01 +02:00
blacken-docs
This commit is contained in:
parent
2f0e64df68
commit
6a2c27b15b
3 changed files with 8 additions and 19 deletions
|
|
@ -233,15 +233,11 @@ As an example, here's a very simple plugin which executes an HTTP response and r
|
|||
|
||||
async def fetch_url(datasette, request):
|
||||
if request.method == "GET":
|
||||
return Response.html(
|
||||
"""
|
||||
return Response.html("""
|
||||
<form action="/-/fetch-url" method="post">
|
||||
<input type="hidden" name="csrftoken" value="{}">
|
||||
<input name="url"><input type="submit">
|
||||
</form>""".format(
|
||||
request.scope["csrftoken"]()
|
||||
)
|
||||
)
|
||||
</form>""".format(request.scope["csrftoken"]()))
|
||||
vars = await request.post_vars()
|
||||
url = vars["url"]
|
||||
return Response.text(httpx.get(url).text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue