put header "Status:400" fails
Posted: Wed Nov 20, 2019 12:39 am
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
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