473,569 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

return HttpStatusCode. ServiceUnavaila ble in the context.context .Response.Statu sCode (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.Statu sCode =
(int)HttpStatus Code.ServiceUna vailable;

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 3830
Response.Append Header("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.Statu sCode =
(int)HttpStatus Code.ServiceUna vailable;

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
2845
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 the HttpWebResponse or HttpResponse to get the status code back but it doesn't seem to work. Is the Response.StatusCode assignment below only...
0
1072
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 set to 304 when necessary always shows up in the server log as a 200 even when the 304 is issued. The browser doesn't error and behaves as...
7
2888
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 to the browser (or spider) before redirecting. Now, the system is reporting a status code of 302 on the original page and a 200 status code on the...
1
6439
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 caller. But when I do so, my caller always reports HTTP error 500. How can I return the actual HTTP status that I received? Here is my code: ...
4
3326
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 database of validated users to determine whether the particular user can actually use the system. If a user is not in the database, I want to respond...
4
10864
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 text files. I searched the Internet and found a basic example which I changed to fit my needs. I tested it out first on a single URL and it worked...
2
2958
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, David Lozzi
2
1271
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 ther server and I want to do it in the HTTP Headers. The status code is "204" for no content.
10
9739
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 returned. So the username and password should be ok. I'm using this code: Merchant myMerch = new Merchant();...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.