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. Advertisements

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,474
    Pete Barrett
    Apr 23, 2005
  2. Justin

    "Content-Length" header

    Justin, Aug 30, 2004, in forum: Python
    Replies:
    2
    Views:
    446
    Peter Hansen
    Aug 30, 2004
  3. Justin

    Re: "Content-Length" header

    Justin, Aug 30, 2004, in forum: Python
    Replies:
    2
    Views:
    366
    Paul Bissex
    Aug 30, 2004
  4. Andy Fish

    HTTP content-length header

    Andy Fish, Aug 2, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    702
    Andy Fish
    Aug 2, 2006
  5. Alexander Smirnov
    Replies:
    3
    Views:
    946
    Alexey Smirnov
    Mar 22, 2007
  6. silk.odyssey
    Replies:
    2
    Views:
    623
    Mark Sapiro
    Oct 20, 2008
  7. Vlad Hrybok
    Replies:
    1
    Views:
    2,094
    bruce barker
    Jan 7, 2009
  8. 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:
    613
    Diego Perini
    Sep 16, 2009
Loading...