commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle R . Burton" <>
Subject 100 Continue
Date Fri, 14 Dec 2001 18:15:42 GMT
I'm using HttpClient to interact with a site that responds to a POST with
the following (produced with netcat: nc hostName 80 < POST.txt):

  HTTP/1.1 100 Continue^M
  Server: Microsoft-IIS/4.0^M
  Date: Fri, 14 Dec 2001 17:45:11 GMT^M
  HTTP/1.1 302 Object moved^M
  Server: Microsoft-IIS/4.0^M
  Date: Fri, 14 Dec 2001 17:45:20 GMT^M
  Location: PRASINDI.ASP?IDNUM=568577^M
  Content-Type: text/html^M
  Cache-control: private^M
  Transfer-Encoding: chunked^M
  <head><title>Object moved</title></head>
  <body><h1>Object Moved</h1>This object may be found <a HREF="PRASINDI.ASP?IDNUM=568577">here</a>.</body>

When I call getResponseBodyAsString(), it returns the entire nested HTTP
response as the body.  It seems to be reading off the first header (the
continue header) just fine, but doesn't seem to process the nested response.

I've tried looking at the code from cvs, and have as of yet been unable
to figure out how it's even reading the nested response.  As far as I can
tell, HttpMethodBase reads the continue header and then stops.  I can
see where execute() checks the response status vs SC_CONTINUE, but again,
as far as I can tell, bodySent is true at that point, so it looks like it
breaks out of the for loop and returns.

I know this has to be incorrect, as getResponseBodyAsString returns 
the nested request.

Also, I've been unable to figure out how to enable logging.  I've tried 
running my code as follows:

java \
  ", consoleAppen
der" \
  ", consoleAppend
er" \
  "-Dlog4j.appender.consoleAppender=org.apache.log4j.ConsoleAppender" \
  TestHttpClient \
  2>&1 | tee out.txt

Any help at all is appreciated.

Thank you for your time,
Kyle R. Burton


Enter in.  Be one with the object of contemplation if you
wish to understand.  Don't be an outside observer of life.
Be life.
        -- T'ao-shan                  

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message