473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

return HttpStatusCode.ServiceUnavailable in the context.context.Response.StatusCode (Http response code 503)

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#?
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jan 23 '07 #1
1 3820
Response.AppendHeader("Retry-After","60"); // 60 seconds

-- bruce (sqlwork.com)

Flip Rayner wrote:
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#?
--Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jan 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Shane | last post by:
Can someone tell me what the Response.StatusCode = "200" is doing below? I have another program that sends a stream of string data to the program below by using an HttpWebRequest. I want to use...
0
by: Adrian Inman | last post by:
I have some image resizing code that resizes images and composites them with watermarks on the fly. I have integrated HTTP eTag aware caching with the code, however, the Response.StatusCode which I...
7
by: Pat Carden | last post by:
I'm trying to provide a better user experience by redirecting my users to a "Page Not Found" page, using a Custom Errors directive in Web.Config. The problem is I need to return a 404 error code...
1
by: google | last post by:
I'm building a small ASPX page in C# to forward HTTP POST requests to another site. When the other site returns an HTTP error such as 404 or 405, I want to return that same HTTP status value to my...
4
by: Martin Robins | last post by:
I have an application which uses Windows Authentication to identify users and ensure that they are on a domain. Once access is granted at this level, I then check their login name against a...
4
by: Hexman | last post by:
Code below ---- I've asked a similar question on this forum earlier. This is a slightly different situation. Previous Question ---- I'm trying to save some specific web pages to disk as...
2
by: David Lozzi | last post by:
Howdy, I'd like to setup an HTML for the error Service Unavailable however I don't see 503 in the Custom Error list in IIS 6 (Win2003 stand sp1). How do I set this up, if possible? Thanks,...
2
by: pbd22 | last post by:
Hi. I feel like i should know this but i dont. How do I get the server to send a specific HTTP response to the browser? I want to tell the browser that there is no content coming back from...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.