SQLPage as an API endpoint #806
-
I am trying to figure out how to create a API endpoint to post data in my database. I was trying Essentially i need to post data from a API with Content-Type specifically being application/json. Is this possible in SQLPage, or should a custom component/ function be built to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @Pieter3033 ! Long time no see ! How have you been doing ? It is currently not possible to read json request bodies, but it's on my long list of planned features. See #316 |
Beta Was this translation helpful? Give feedback.
You know what, I'll build it for the next update. I've delayed that one for too long !
I'll add two functions,
sqlpage.request_body()
that returns the body as a string (on which you can then use your database's json functions)sqlpage.request_body_base64()
that encodes the request body as base64, for easily storing the results, or converting it to a data-url.example
echo_server.sql
result