Closed
Description
Discussed in #315
Originally posted by stefanov-sm May 13, 2024
Motivation
Build REST services that support GET, POST, PUT, DELETE, ...
request methods and arbitrary length raw JSON input
Suggestion - add two more functions
sqlpage.request_method()
function that returns the request method as text. This would allow for code like
select case sqlpage.request_method()
when 'GET' then (...)
when 'POST' then (...)
when 'PUT' then (...)
...
end;
sqlpage.request_body()
function that returns the request body payload as raw text. This would allow for code like (PostgreSQL)
with t(j) as
(
select jsonb_array_elements(sqlpage.request_body()::jsonb)
)
...
Expected result
A fully functional REST services development toolset based on the JSON component.