hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Uday Subbarayan <uday.subbara...@yahoo.com>
Subject PUT & Expect:100-continue
Date Thu, 17 Jul 2008 00:34:00 GMT
Hi All,
    I am having trouble in using HTTPClient 3.1 for PUT method w/ "Expect:100-Continue"
header. 

My requirement is that,
[1] client sends a PUT request to the server with header only using this Expect header and
waits for the 100 response back from the server.
[2] Then client sends the body, after it received the 100 status back from the server.

The problem is that if my server sends back 100-continue, HttpClient complaints about,
"INFO: Discarding unexpected response: HTTP/1.1 100 Continue".

Here is sample code:
          String testURL="http://localhost:8080/testci/index";
          HttpClient client = new HttpClient();
          
          PutMethod put = new PutMethod(url);
          put.setUseExpectHeader(true);
          int statusCode = client.executeMethod(put);
          
          
          if(statusCode==100){
              System.out.println("server response is 100!");
              put.setRequestBody(new FileInputStream("test.txt"));
          }
----------------------------

It looks like i am making some mistake.... Can some one shed some light here?

Thanks,
-Uday.

-------------------------

I do not blog but e-write:

http://uds-web.blogspot.com


      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message