Can the HTTP Response Code Be Changed?
Posted: Sun May 06, 2012 11:25 am
Hi all,
I am trying to setup a RESTful server in On-Rev. If the client is trying to perform an operation at a certain URL, and that operation is not allowed - ie., the client is trying to 'POST' information to a URL that only accepts 'GET' requests - then my response should contain a "405" status code + a list of the acceptable http methods at that URL. By default, however, the On-Rev server always issues "200 OK" status, if the script file is found and run.
I cannot find a way to change the http response code in On-Rev. Is this possible?
I am trying to setup a RESTful server in On-Rev. If the client is trying to perform an operation at a certain URL, and that operation is not allowed - ie., the client is trying to 'POST' information to a URL that only accepts 'GET' requests - then my response should contain a "405" status code + a list of the acceptable http methods at that URL. By default, however, the On-Rev server always issues "200 OK" status, if the script file is found and run.
I cannot find a way to change the http response code in On-Rev. Is this possible?