Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
HTTP Status code
Rolf_Poser_(sbsuser06_-_(deleted))
I'd like to be able to send a specific HTTP status code to the browser on output, e.g. a redirect command. (And no, the "location:" http header won't do)How do I add this to the output sent back to the cgi for inclusion as part of the HTTP reply?Setting it somewhere along the way as "HTTP_STATUS" or "STATUS" or "SERVER_STATUS" as follows in my requesthandler doesn't seem to work: Assoc intermediateR = Assoc.FromRecord( r ) intermediateR.HTTP_STATUS = 404 r = Assoc.ToRecord( intermediateR )Is it even possible to set this and override the default status code of 200?I know that most browsers will redirect based on the "Location" header alone, but I would like to be able to implement it in a more compliant way.My detail requirement is too complex to explain here. A simple "it's possible/not possible" will be helpful. If yes - please explain how.Thanks!
Find more posts tagged with
Comments
Rolf_Poser_(sbsuser06_-_(deleted))
I've made some progress - if one uses Web.WriteHeaders ( socketRef, '302 Object Moved', ( 'Location:
http://otherserver.com'
+ Web.CRLF + 'Connection: close' + Web.CRLF ) )This works fine for a normal browser session.It seems to do the trick partially, BUT the problem I have is that with the other client is trying to do a "POST" onto the server, and the server first gives a "100 Continue", then never interprets the above for inclusion in the response, and in stead does a "200 OK".Any ideas?Maybe one can "downgrade" the server to only use HTTP/1.0 - can one?Thanks.