cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP POST: Determining whether a file could be found

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 9 Sep 2002 14:17:10 +0200 (MET DST)

On Mon, 9 Sep 2002, Holger Rauch wrote:

> > Also, try using the CURLOPT_DEBUGFUNCTION for very detailed information
> > on what is sent or received. It gives more information than plain VERBOSE
> > does.
>
> If I understand the curl_easy_setopt man page right, hat means I have to
> provide my own callback. Are there any examples for debug functions in the
> libcurl distro? I've been looking in the docs/examples subdir, but I
> couldn't find any.

You can check out the my_trace() function in src/main.c which is how the curl
tool uses that callback for full trace output.

> > Content-Type: multipart/form-data is used by default for multipart
> > formposts, but for the request-headers not this single form field.
>
> It's now set to text/xml. Besides, my mistake was that I was using the
> wrong field name. Everything works now. My HTTP POSTs don't go to CGI
> scripts (as it might be the usual way of doing things), but rather to an
> URL that's handled by a specific Apache module. That module expects certain
> form field names and I wasn't aware that CURLFORM_COPYNAME is used to set
> the name of a particular field in the form. (I've looked at the examples in
> the libcurl guide, but I should have been looking at the curlform_add man
> page, too.)

I'm happy it works for you now!

If you think you can improve/clarify this in the examples or even the man
pages, then please go ahead and mail us diffs!

> > 'Accept: text/xml' - I can't see any reason why you need it, but if you
> > do, you should probably set it using CURLOPT_HTTPHEADER to control the
> > HTTP request.
>
> I need it, because the server returns XML output. The corresponding MIME
> type for that is either "text/xml" or "application/xml". Do you think it's
> redundant?

I think so. Veeeeery few server-side "things" actually care about the Accept:
line. But then again, if it works for you with it, you can just as well keep
it! ;-)

-- 
 Daniel Stenberg -- curl related mails on curl related mailing lists please
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
Received on 2002-09-09