First of all, if you’re using a free Wix site so these requests are wrong.
The request should be something like:
https://mysite.wixsite.com/mysite/_functions/%D7%9B%D7%9C%D7%99%D7%9D
It will be better if you encode it before you call the request (see above).
And maybe the best way would be to use POST (then you won’t have to encode or decode anything.
POST REQ
fetch("https://mysite.wixsite.com/_functions/allProductsInCategory",
{"method": "post",
"body": JSON.stringify({
"name": "כלים",
"data": {
"name": "מחבת",
"subcategory": "כלי בישול"
}
})
}
)
And on your http-function
async function post_allProductsInCategory(req) {
const body = await req.body.json();
const name = body.name;
switch(name){
case "כלים":
//do something with the data
break;
case "רהיטים":
//do something with the data
break;
//etc...
}
}