cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl_easy_perform blocks when trying to read a response Header

From: Michael Ludwig <mlu_at_as-guides.com>
Date: Thu, 06 Nov 2008 15:25:11 +0100

Ambarish Mitra schrieb:
> I am trying to get the HTTP response from a simple servlet. The
> trouble is: the program blocks at curl_easy_perform, and does not come
> out of it even if the servlet has completed.
>
> I have a running test Java servlet (deployed on Tomcat), which returns
> a response code of 200.

It is certainly running, but maybe not in the direction you want.

> protected void doGet(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException
> {
> System.out.println("doget - start ");

The problem is that you're printing to the standard output, but the
Servlet API doesn't work that way. Take a look at the documentation here
to find out how you're supposed to use this API.

http://java.sun.com/products/servlet/docs.html
http://www.novocode.com/doc/servlet-essentials/
http://www.novocode.com/doc/servlet-essentials/chapter2a.html#ch_2_1

If you wonder where your output goes, take a look at the server's log
files.

This doesn't have anything to do with curl.

I hope this helps.

Michael Ludwig
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-11-06