I'm teaching myself to build a REST API using LC Server. I've got my prototype API running on hostm (which was very easy to get going). I'm testing using Postman. I've encountered a weird little problem.
The below works fine -
<?lc
put header "Status:428"
put "It all went South"
?>
Postman receives the status code 428 and "It all went south".
But if I substitute -
<?lc
put header "Status:400"
put "It all went South"
?>
Postman receives the status code 403 (Forbidden) and does NOT receive "It all went south".
I've tested about 5 other header status codes. They all worked.
I can easily work around this by putting a status code other than 400 (although none of the others accurately reflects the nature of the problem). I don't know if this is a LC issue or a hostm issue, but I thought that I'd try the forum first. Has anyone seen this before, or can you reproduce it, or is it definitely a hostm issue, or something else?
Thanks
Kim
put header "Status:400" fails
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: put header "Status:400" fails
I tested for you.
I get in both cases "It went south", so it works here.
No errors.
I get in both cases "It went south", so it works here.
No errors.
Re: put header "Status:400" fails
Thanks for checking that. I'll try asking hostm.
Regards
Kim
Regards
Kim
Re: put header "Status:400" fails - CLOSED
Hostm got back to me (very quickly) with the following -
"We can confirm that the issue with status code 400 is not LiveCode-specific, as we’ve tested it with other server-side languages with the same result on our servers. It appears to be have something to do with LiteSpeed, the web server that we utilize, since the issue does not occur with the standard web server (Apache) that comes with cPanel."
"We can confirm that the issue with status code 400 is not LiveCode-specific, as we’ve tested it with other server-side languages with the same result on our servers. It appears to be have something to do with LiteSpeed, the web server that we utilize, since the issue does not occur with the standard web server (Apache) that comes with cPanel."
Re: put header "Status:400" fails
<silly aside>What if you try Status:418?</silly aside>