I'm trying to understand how this function behaves. I imagined it would be like a Case Switch, but in the first tests the result wasn't what I expected.
Here I created an API to return a Response value if $_HEADER.status comes with a certain value.
Looking at the Wappler terminal, it captures the data in the correct $_HEADER, but the select statement doesn't behave as expected.
It seems the api returns a string '500' and your cases use numeric values like 500. Try checking for strings '500' '200' and '400' instead.
'500'
500
'200'
'400'
If other status codes can be returned i.e.401, 403 etc, you may be better to convert to numeric and test via ranges like value >399 && <500
It worked by handling the value for toNumber()...thank you @Teodor