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

Discussion in 'ASP .Net' started by Flip Rayner, Jan 23, 2007.

  1. Flip Rayner

    Flip Rayner Guest

    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/
     
    Flip Rayner, Jan 23, 2007
    #1
    1. Advertising

  2. Flip Rayner

    bruce barker Guest

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

    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/
     
    bruce barker, Jan 23, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jesse Napier

    CustomErrors statusCode 500

    Jesse Napier, Aug 7, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    4,825
    Michal A. Valasek
    Aug 7, 2003
  2. Shane
    Replies:
    1
    Views:
    3,095
    Anthony Williams
    Nov 21, 2003
  3. Shane

    Response.StatusCode

    Shane, Nov 20, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,885
    Shane
    Nov 20, 2003
  4. clintonG

    HttpStatusCode Enumerations...

    clintonG, May 5, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    4,060
    clintonG
    May 6, 2004
  5. =?Utf-8?B?U3VzaGlTZWFu?=

    Response.StatusCode problem

    =?Utf-8?B?U3VzaGlTZWFu?=, Nov 7, 2007, in forum: ASP .Net
    Replies:
    10
    Views:
    2,108
Loading...

Share This Page