Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 43288 invoked from network); 6 Jan 2006 14:35:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jan 2006 14:35:25 -0000 Received: (qmail 16939 invoked by uid 500); 6 Jan 2006 14:35:22 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 16907 invoked by uid 500); 6 Jan 2006 14:35:21 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 16895 invoked by uid 99); 6 Jan 2006 14:35:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2006 06:35:21 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.72.192.243] (HELO fmmailgate05.web.de) (217.72.192.243) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2006 06:35:21 -0800 Received: by fmmailgate05.web.de (8.12.10/8.12.10/webde Linux 0.7) with SMTP id k06EYHCU030948 for ; Fri, 6 Jan 2006 15:34:59 +0100 Received: from [62.206.40.35] by freemailng0502.web.de with HTTP; Fri, 06 Jan 2006 15:34:59 +0100 Date: Fri, 06 Jan 2006 15:34:59 +0100 Message-Id: <306820792@web.de> MIME-Version: 1.0 From: Lothar Krenzien To: httpclient-user@jakarta.apache.org Subject: cant't get HttpClient working Organization: http://freemail.web.de/ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi , I have a JUnit test in which I want to post data to a servlet which runs under tomcat 5.5.4. I created the post like this: HttpClient client = new HttpClient(); PostMethod method = new PostMethod(URL); method.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1"); NameValuePair[] data = { new NameValuePair(DataLoggerGate.PARAM_NAME_DATATYPE, Constants.PARAM_NAME_DATATYPE_EFFICIENCY_BLOCK_DATA), new NameValuePair(DataLoggerGate.PARAM_NAME_LOGGER, "DL-CO101-00000") }; method.addParameters(data); //method.setRequestBody(data); int statusCode = client.executeMethod(method); String responseBody = method.getResponseBodyAsString(); System.out.println(responseBody); But when I try to read the posted parameters in my servlet like this String dataType = (String)request.getParameter(PARAM_NAME_DATATYPE).trim(); I get always a NullPointerException. And when take a look at the request object in the debugger I see that no parameters are included in the request. What I'm doing wrong ? Thanks, Lothar ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org