hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: PostMethod response.
Date Wed, 09 Apr 2003 14:49:57 GMT
Fran├žois,

There are three possible approaches:

- Update to a recent nightly build

http://jakarta.apache.org/commons/httpclient/downloads.html

- Use HTTP/1.0
  
  post.setHttp11(false);

- Disable 'expect: 100-continue' handshake

  post.setUseExpectHeader(false);

I hope this helps

Oleg


-----Original Message-----
From: francois.geraerts@b-rail.be [mailto:francois.geraerts@b-rail.be]
Sent: Wednesday, April 09, 2003 17:27
To: commons-httpclient-dev@jakarta.apache.org
Subject: PostMethod response.


Hi!

I am sending a File to an https server.
With the version alpha2, and use of the PostMethod, i've got a good response
from the server.
With the version aplha3, i have always a code 100 Continue.

Here is my code:


  HttpClient session  ........

  .......

    PostMethod post = new PostMethod(hpp.getUrl());
    post.addRequestHeader("Content-Type", hpp.getContentType());
    post.setHttp11(true);



     String strReq = new String(request);
     post.setRequestBody(strReq); ///Setting of the byte to send
     post.setRequestContentLength(strReq.length());


      session.executeMethod(post);


    BufferedReader postReader = null;


    try
    {
      postReader = new BufferedReader(new InputStreamReader(post.
getResponseBodyAsStream()));
    }
    catch (IOException ex1)
    {
      throw new HttpsBrokerException(4,"sendFile","Error on the response body:
" + ex1.getMessage());
    }
    catch (NullPointerException ex)
    {
      postReader = null;
    }

    serverResponse = new HttpServerResponse(post.getStatusLine(),postReader);


    Is someone know the change done between the two version and why now it
doesn't work.

    Thanks in advance.

    Fran├žois


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message