Thanks, that did work. Here is my test file. It returns the JSON I send it:
export async function post_sendjson ( request )
{
let sError = “” ;
let payload = await request . body . json ()
. catch ( e => sError = e );
let response =
{
"headers" :
{
"Content-Type" : "application/json"
}
};
response . body =
{
"status" : "SENDJSON Run Complete" ,
"error" : sError ,
"params" : payload
}
**return** ok ( response );
}
and here is my CURL script:
set url=“https://wixsite.com/lbksystest/_functions-dev/sendjson”
curl -X POST %url% ^
-H “Content-Type: application/json” ^
–data-binary @sendjson.dat
It takes a long time to find this simple solution!
Thanks a lot! And for your quick reply!
Lawrence