Solved

Apache HttpCLient ->  Getting the server message based on status code

Posted on 2004-10-15
2
158 Views
Last Modified: 2011-09-20
here is how we get status.
        int status = client.executeMethod(method);

Now how to get the server message based on status using client object??

Regards
Sudhakar

0
Comment
Question by:sudhakar_koundinya
  • 2
2 Comments
 
LVL 19

Accepted Solution

by:
ramazanyich earned 125 total points
ID: 12319867
if (statusCode != HttpStatus.SC_OK) {
        System.err.println("Method failed: " + method.getStatusLine());
      }

      // Read the response body.
      byte[] responseBody = method.getResponseBody();
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12319882
Check tutorial for HttpClient for usage guidelines:
http://jakarta.apache.org/commons/httpclient/tutorial.html
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now