locked
REST Problem with 401 RRS feed

  • Question

  • I'm using the REST starter kit to call out to an external REST based system to get some HttpResponseMessages

    Problem seems to be that the code doesn't complete the GET or DELETE unless I have fiddler up and running...then it all works perfectly.  The minute I close down fiddler, the GET and DELETE just hang and wait for the timeout message.

     

    This is all the code is

    HttpClient http = new HttpClient(baseAddress);
    
          HttpResponseMessage response = http.Get(String.Format("/service/api/login/ticket/{0}?ticket={0}", ticket));
    
          if (response.StatusCode == System.Net.HttpStatusCode.OK)
            return true;
          else 
            return false;
    

    So if the ticket querystring I'm passing in is invalid it should return a 401...otherwise a 200.

    Now if the response IS a 200, then this works great as is (without fiddler), but the minute I try a 401 test, I just sit waiting for the timeout.

     

    Any idea why that might be?

    Tuesday, May 24, 2011 2:32 PM

All replies

  • Is there a non-zero content length in the response header when you get a 401.  Is the server waiting for you to read the body?  Fiddler will buffer any content it receives.  This would free up the server to continue.
    Darrel
    Tuesday, May 24, 2011 7:13 PM