Setting Content-Length Header for HTTP 204?

Discussion in 'ASP .Net Web Services' started by Eric, Oct 20, 2004.

  1. Eric

    Eric Guest

    Hello,

    Can someone help out with forcing the Content-Length header to 0 when
    returning an HTTP 204 with NO body (working in a WSE2.0 web service) I can't
    seem to gain access to the Content-Length Header

    I'm trying the following:
    HttpResponse httpResponse = Context.Response;
    httpResponse.AppendHeader("Content-Length", z.ToString());
    httpResponse.StatusCode = i;
    httpResponse.Flush();
    Seems that there is an override behavior somewhere outside of the WebMethod
    that is stripping out the content-Length header.

    -thanks!
     
    Eric, Oct 20, 2004
    #1
    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. GaryM
    Replies:
    3
    Views:
    1,078
    Pete Barrett
    Apr 23, 2005
  2. Alexander Smirnov
    Replies:
    3
    Views:
    845
    Alexey Smirnov
    Mar 22, 2007
  3. silk.odyssey
    Replies:
    2
    Views:
    476
    Mark Sapiro
    Oct 20, 2008
  4. Vlad Hrybok
    Replies:
    1
    Views:
    1,851
    bruce barker
    Jan 7, 2009
  5. Thomas 'PointedEars' Lahn

    [FYI] MSXML HTTP translates response status code 204 to 1223

    Thomas 'PointedEars' Lahn, Sep 7, 2009, in forum: Javascript
    Replies:
    4
    Views:
    388
    Diego Perini
    Sep 16, 2009
Loading...

Share This Page