SQLPage as an API endpoint #806
Answered
by
lovasoa
Pieter3033
asked this question in
Q&A
|
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? |
Answered by
lovasoa
Feb 10, 2025
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 |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.sqlresult