return HttpStatusCode.ServiceUnavailable in the context.context.Response.StatusCode (Http response c

F

Flip Rayner

I am writing an HTTPHandler that is basically a transparent proxy / URL
Mapper.

I have a line in my code to return a 503:
context.context.Response.StatusCode =
(int)HttpStatusCode.ServiceUnavailable;

I am lead to believe that there is the ability to specify the
"retry-after" parameter in the header, but I am unsure how to do it in
..Net2


From: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
"The server is currently unable to handle the request due to a temporary
overloading or maintenance of the server. The implication is that this is
a temporary condition which will be alleviated after some delay. If known,
the length of the delay MAY be indicated in a Retry-After header. If no
Retry-After is given, the client SHOULD handle the response as it would
for a 500 response."

Does anyone know how to specify the length of delay in the "retry-after"
header using .Net2 / C#?
 
B

bruce barker

Response.AppendHeader("Retry-After","60"); // 60 seconds

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top