Hi,
Do anyone know that how curl doing POST in second request? Means at the first request curl using redirect but for the second request is POST method.
Appreciate for you help.
Thanks
Lik Chin
Hi,
Do anyone know that how curl doing POST in second request? Means at the first request curl using redirect but for the second request is POST method.
Appreciate for you help.
Thanks
Lik Chin
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "a_=_a&b_=_b");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "a=a&b=b");
the code above is doing for first request. how about the second request? For example,
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.abc.com');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$res = curl_exec($ch);
curl_close($ch);
the www.abc.com will POST (not redirect) to another server call www.def.com. and then www.def.com will back to ww.abc.com and come back to my application.
My problem now is the curl never return back to my application. I think some connection loss in between.
Please help....
Thanks.
Initialize a new curl session for that ...
how to initialize a new curl session? because the www.abc.com post directly to www. def.com already.
Initialize a curl session send by POST your data from www.abc.com to www.def.com follow the link, then initialize another curl session send by POST your data from www.def.com to www.abc.com follow the link ...
the prolem now is after i curl to www.abc.com i do not have access to www.def.com because www.def.com is third party. I am not sure, is it curl can do POST in middle of redirection?
GET POST GET
my application -----> www.abc.com ------> www.def.com ------->www.abc.com -------->my application
I'm not sure that u can POST ----> POST OR GET ----> GET with only one session, u can follow link in case of some redirects ...
Is there any special option for me to allow POST in the middle of redirection?
I dont think there is, u should rethink your script, anyway u can create another thread with your last question ...