Page 1 of 1
curl - Need Help
Posted: Sat Sep 12, 2009 3:59 pm
by jaiswarvipin
Hi All,
Re: curl - Need Help
Posted: Sat Sep 12, 2009 4:35 pm
by Darhazer
Add CURLOPT_FOLLOWLOCATION option to the curl
Re: curl - Need Help
Posted: Sun Sep 13, 2009 1:54 pm
by jaiswarvipin
Thanks , it works.
Re: curl - Need Help
Posted: Sun Sep 13, 2009 1:59 pm
by Darhazer
For some reason the live server gives 301 - Moved permanently on that URL. Normally browser will just redirect you to the new location, but curl does not, unless you specify FOLLOWLOCATION
Re: curl - Need Help
Posted: Sun Sep 13, 2009 2:13 pm
by jaiswarvipin
Hi it work,
Re: curl - Need Help
Posted: Sun Sep 13, 2009 2:26 pm
by Darhazer
Add:
echo $xml / var_dump($xml)
before initializing SimpleXML
in order to see what the server is receiving
P.S. It seems that the server does not receive anything.
Re: curl - Need Help
Posted: Mon Sep 14, 2009 7:19 am
by jaiswarvipin
very true,
Re: curl - Need Help
Posted: Mon Sep 14, 2009 1:52 pm
by Darhazer
The problem is that it does not post the data when the servers redirects to another URL
Maybe this is according to a RFC, I don't know.
Maybe there is workaround. Dig for it.
Or instead of CURLOPT_FOLLOWREDIRECT, parse the header of the response, and if it is 3xx, post the data to the new location. Manually.
Re: curl - Need Help
Posted: Wed Sep 16, 2009 4:53 pm
by jaiswarvipin
I have enable the Header true and found this response form server.
Re: curl - Need Help
Posted: Thu Sep 17, 2009 6:13 am
by jaiswarvipin
Thanks a lot.
AS you suggested i have dig into that and you line instruction is 100% right?
Server response is going some where else, after monitoring i have found that server send's the response but it get redirected to other server whcih is not exists at all.
Thanks a lot dear.
