cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: bad post strings?

From: Ryan Earl <heretic_at_mail.utexas.edu>
Date: Fri, 08 Jun 2001 00:14:00 -0500

At 04:40 PM 6/4/2001 -0500, you wrote:
>please disreguard the part of my reply concerning the warnings during
>the make, I have resolved those.I was not coping the libs to my system
>lib directory. I do not receive the warnings but the problem still
>exists.
>The rate of bad post strings is approximately 50% and random in nature.

Sounds like you just need a Content-Type of application/x-www-form-urlencoded instead of multipart/form-data like Curl uses. You can just URL encode your post data, set the Content-Type HTTP header to what you want, and raw send the encoded information. Some CGI things don't understand the newer multipart/form-data Content-Type.

"curlcnc9d89refkrehfy" is the separator for form information. For instance, when I use curl to do a post, I get the header:

Content-Type: multipart/form-data; boundary=curlns9dzEEZRwrna6gRCWXK80PklWY

I'm not sure if there is a simpler way to make Curl do a URL encoded POST, but it's fairly easy to do by hand.

>jb
>
>Daniel Stenberg wrote:
>>
>> On Sun, 3 Jun 2001, John Baxter wrote:
>>
>> > while using libcurl 7.7.3-1 on linux 2.4.2-2 (rh7.1) i loop performing
>> > multiple rfc-1867 posts to return the results of a query. i create and
>> > destroy a list with formparse(). some of the posts result in an error
>> > from the server saying my post is invalid. the server responds with my
>> > post value with junk appended to my intented post value. the bad values
>> > have my post string followed by "curl" which is followed by junk. ex:
>> > "99-10013curlcnc9d89refkrehfy" where "99-10013" is the value I intended
>> > to post. I perform a printf(post->contents) prior to curl_easy_perform()
>> > and is is always correct at that point. any ideas?
>>
>> (I also just replied to the bug report in this subject.)
>>
>> Is the 'post' and 'last' pointers really set to NULL before you use
>> curl_formparse() the first time? If they're not, this might very well be an
>> explanation to why junk ends up in the list.
>>
>> If that is not the problem, I suggest that you compile lib/formdata.c with
>> _FORM_DEBUG defined and have a go at fixing a test that passes the exact same
>> set of form data as you do in your program. Then you can run that test
>> program and see what kind of output you get. If it looks ok, the problem is
>> in your code, if it still looks weirdo, then libcurl is to blame and I'd
>> appriciate you telling me exactly how to repeat it!
>>
>> --
>> Daniel Stenberg -- curl dude -- http://curl.haxx.se/
>>
>> _______________________________________________
>> Curl-library mailing list
>> Curl-library_at_lists.sourceforge.net
>> http://lists.sourceforge.net/lists/listinfo/curl-library
>
>_______________________________________________
>Curl-library mailing list
>Curl-library_at_lists.sourceforge.net
>http://lists.sourceforge.net/lists/listinfo/curl-library

_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-06-08