-
-
Notifications
You must be signed in to change notification settings - Fork 813
Closed
Description
The main branch of Datasette 1.0a does NOT support Content-Type: application/json; charset=utf-8:
Actual Result:
POST /db/messages/-/insert HTTP/1.1
Content-Type: application/json; charset=utf-8
Content-Length: 117
Host: 10.0.2.2:8001
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/4.12.0
{"row":{"body":"my feedback","body_format":"T","from_email":"bk@bk.com","from_name":"BK","title":"Contact Feedback"}}
-----
HTTP/1.1 400 Bad Request
date: Tue, 06 Aug 2024 04:24:45 GMT
server: uvicorn
content-type: application/json; charset=utf-8
Transfer-Encoding: chunked
{"ok": false, "errors": ["Invalid content-type, must be application/json"]}Expected Result:
POST /db/messages/-/insert HTTP/1.1
Content-Type: application/json
Content-Length: 117
Host: 10.0.2.2:8001
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/4.12.0
{"row":{"body":"my feedback","body_format":"T","from_email":"bk@bk.com","from_name":"BK","title":"Contact Feedback"}}
------
HTTP/1.1 201 Created
date: Tue, 06 Aug 2024 04:32:57 GMT
server: uvicorn
content-type: application/json; charset=utf-8
Transfer-Encoding: chunked
{"ok": true, "rows": [{"id": 13, "from_user_id": null, "from_name": "BK", "from_email": "bk@bk.com", "to_user_id": null, "title": "Contact Feedback", "body": "my feedback", "body_format": "T", "sent_on_utc": "2024-08-06 04:32:58"}]}The bug is on the line:
datasette/datasette/views/table.py
Line 367 in f6bd2bf
| if request.headers.get("content-type") != "application/json": |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels