You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Wilcox, Mark" <Ma...@webct.com> on 2003/05/09 00:00:14 UTC
how to "continue" following a 100 status message with a PUT
Hi,
I'm doing a PUT (example code below) to a MS Exchange server (which speaks DAV). I'm not using Slide because I can't seem to get it to NTLM authentication and I only need GET and PUT support for now.
Anyway, when I do PUT, the server returns back with status code of 100 and message "Continue". How exactly should I "continue" with the PUT?
thanks,
Mark
------------
...
PutMethod put = new PutMethod(putURL);
Header contentHeader = new Header();
contentHeader.setName("Content-Type");
contentHeader.setValue("text/plain");
put.addRequestHeader(new Header("Translate","f"));
put.addRequestHeader(contentHeader);
put.setDoAuthentication(true);
FileInputStream in = null;
try {
//f is defined earlier.
in = new FileInputStream(f);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
put.setRequestBody(in);
put.setRequestContentLength((int)f.length());
int status = -1;
try {
status = client.executeMethod(put);
} catch (HttpException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
System.out.println("status is "+status);
System.out.println("status message is "+put.getStatusText());
Re: how to "continue" following a 100 status message with a PUT
Posted by Michael Becke <be...@u.washington.edu>.
Mark,
Sounds like you are using alpha-3. You should upgrade to a recent
nightly build.
Mike
On Thursday, May 8, 2003, at 06:00 PM, Wilcox, Mark wrote:
> Hi,
> I'm doing a PUT (example code below) to a MS Exchange server (which
> speaks DAV). I'm not using Slide because I can't seem to get it to
> NTLM authentication and I only need GET and PUT support for now.
>
> Anyway, when I do PUT, the server returns back with status code of 100
> and message "Continue". How exactly should I "continue" with the PUT?
>
> thanks,
>
> Mark
>
>
> ------------
> ...
> PutMethod put = new PutMethod(putURL);
>
> Header contentHeader = new Header();
>
> contentHeader.setName("Content-Type");
>
> contentHeader.setValue("text/plain");
>
> put.addRequestHeader(new Header("Translate","f"));
>
> put.addRequestHeader(contentHeader);
>
> put.setDoAuthentication(true);
>
> FileInputStream in = null;
>
> try {
>
> //f is defined earlier.
>
> in = new FileInputStream(f);
>
> } catch (FileNotFoundException e) {
>
> // TODO Auto-generated catch block
>
> e.printStackTrace();
>
> }
>
> put.setRequestBody(in);
>
> put.setRequestContentLength((int)f.length());
>
> int status = -1;
>
> try {
>
> status = client.executeMethod(put);
>
> } catch (HttpException e1) {
>
> // TODO Auto-generated catch block
>
> e1.printStackTrace();
>
> } catch (IOException e1) {
>
> // TODO Auto-generated catch block
>
> e1.printStackTrace();
>
> }
>
> System.out.println("status is "+status);
>
> System.out.println("status message is "+put.getStatusText());
>
>
>