cURL / Mailing Lists / curl-users / Single Mail

curl-users

Posting with curl

From: Rafael Barbosa <rrbarbosa_at_gmail.com>
Date: Sat, 17 May 2008 12:52:54 +0200

Hello there,

I've been making some simple scripts with curl for about 1 month now. My
goals are simple, I have a http form that insert new wiki pages in a server.
The parameters are only 3, pagetitle, namespace and text.

So far my script generates a text file with the three parameters in a
separating the parameters by '&', and the after some checks, i call the
'curl' command to perform the post, so far no promblems, the pages are
inserted correctly. Now I discover that this aproach is not quite good, as
is possible that if two process are executing my script, one could write the
file and the second overwrite it, before the curl command of the first
proccess is executed.

As a workaround, i tryed not to save the file, and form send the string
directly from the variable I had, but it just doesnt work. Is there any
thing I should pay attention while changing the command from:

curl -b $cookie_file -d @$event_file
http://www.myserver.com/wiki/index.php/Special:AddArticle >> $log_file 2>&1

to

curl -b $cookie_file -d "\"$EVENT\""
http://www.myserver.com/wiki/index.php/Special:AddArticle >> $log_file

Notice that before I simply called echo $EVENT > $event_file, and it work...
the content of the text file and the variable are the same.

Thanks in advance,
Rafael Barbosa
Received on 2008-05-17