Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2004-10-15
2
169 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
even odd program using while loop 3 60
servlet example issue 6 46
Eclipse for Java EE development 2 27
junit as external jar or library 7 22
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

839 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