473,699 Members | 2,384 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 3836
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
2849
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 visiable to the web application below or is this the response that is sent back to any programs that...
0
1078
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 expected, but I want to be able to log the 304s as 304s, not 200s with a VERY small contentlength. ...
7
2900
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 error page. I would like to use Google Sitemaps and they require this, plus I have a...
1
6449
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: private void Page_Load(object sender, System.EventArgs e) {
4
3330
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 with the same error page as would be seen if they failed the windows authentication; the 403...
4
10893
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 fine. Now when I incorporate an array of URL's, it fails to work. The first "responseFromServer"...
2
2959
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
1276
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
9771
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(); myMerch.merchantIdentifier=merchantId;
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8613
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8908
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4374
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
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

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.