curl-users
Re: problem with POST on Redirecting!
Date: Sun, 8 Dec 2002 21:43:52 -0800 (PST)
Daniel Stenberg, Ralph Mitchell, and Philippe Lhoste
Thank you very much for the support extended by You.
My sys/webadmins changed the site structure and now it
is setup without the redirecting URL's. ( the login
page infact is a redirected one, but it is working as
we discussed about it before. )
Now i continued my c-program with curl. I will
comeback to you if i get any probs. Of course there
are two issues, which i'm using a workaround though::
-------------------------------------------------------
sprintf(extr,"%s","f_sev=1&f_m_st=1&f_m_num=1&submit=Submit");
sprintf(tmp,"\"f_sub=\"%s\"&f_des=\"%s\"&%s\"",subj,desc,extr);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, tmp);
------------------------------------------------
for this the probs are:
1) in the seconf sprintf statement, the first field
is being stripped off while submitting. i.e f_sub=""
is not being submitted in the POST.
workaround::
i used a dummy=dummy field before f_sub, to cheat it,
so final statement is ::
sprintf(tmp,"\"dummy=dummy&f_sub=\"%s\"&f_des=\"%s\"&%s\"",subj,desc,extr);
----------------------------------
2) for the f_desc="..." there is a lot of data, with
so many keybord characters including """ and "'" for
this with the help of my friend i converted it to,
before submitting...
while(mtmp = strchr(tmp,'\'')) {
*(mtmp) = '#';
}
which changes all of the "'" to "#" from the above
said
'tmp' variable and then submits
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, tmp);
-----------------------------------------------
Also when we are submitting,
if we specify verbose, we get the details to stdout.
in any case we get the fetched page to stdout. What if
i wanted to just submit the page and dont want any
output. Ofcourse we have an option to send it to a
file. What if i dont even wanted to send the output to
a file. Is there a way if i wanted to run my code in a
complete silent mode??
Bye
Sanjeev
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-12-09