You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Kyle R . Burton" <mo...@voicenet.com> on 2001/12/14 19:15:42 UTC

100 Continue

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
  ^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
  ^M
  92^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>
  ^M
  0^M
  ^M

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 \
  "-Dlog4j.category.org.apache.commons.httpclient.HttpMethod=DEBUG, consoleAppen
der" \
  "-Dlog4j.category.org.apache.commons.httpclient.HttpMethod=INFO, 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
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>