home / github / issue_comments

Menu
  • GraphQL API

issue_comments: 692832113

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/issues/967#issuecomment-692832113 https://api.github.com/repos/simonw/datasette/issues/967 692832113 MDEyOklzc3VlQ29tbWVudDY5MjgzMjExMw== 9599 2020-09-15T16:34:53Z 2020-09-15T16:37:43Z OWNER This is so weird. In the test I wrote for this the following passed: response = magic_parameters_client.post("/data/runme_post?_json=1", {}, csrftoken_from=True) But without the `csrftoken_from=True` parameter it failed with the bindings error: response = magic_parameters_client.post("/data/runme_post?_json=1", {}) Here's the test I wrote: ```python def test_magic_parameters_json_body(magic_parameters_client): magic_parameters_client.ds._metadata["databases"]["data"]["queries"]["runme_post"][ "sql" ] = "insert into logs (line) values (:_header_host)" response = magic_parameters_client.post("/data/runme_post?_json=1", {}, csrftoken_from=True) assert response.status == 200 assert response.json["ok"], response.json post_actual = magic_parameters_client.get( "/data/logs.json?_sort_desc=rowid&_shape=array" ).json[0]["line"] ``` {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} 702069429  
Powered by Datasette · Queries took 2.207ms