curl - Need Help
Moderator: General Moderators
-
jaiswarvipin
- Forum Commoner
- Posts: 32
- Joined: Sat Sep 12, 2009 3:43 pm
- Location: India
curl - Need Help
Hi All,
Last edited by jaiswarvipin on Tue Sep 22, 2009 10:58 am, edited 2 times in total.
Re: curl - Need Help
Add CURLOPT_FOLLOWLOCATION option to the curl
-
jaiswarvipin
- Forum Commoner
- Posts: 32
- Joined: Sat Sep 12, 2009 3:43 pm
- Location: India
Re: curl - Need Help
Thanks , it works.
Last edited by jaiswarvipin on Tue Sep 22, 2009 10:58 am, edited 1 time in total.
Re: curl - Need Help
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
-
jaiswarvipin
- Forum Commoner
- Posts: 32
- Joined: Sat Sep 12, 2009 3:43 pm
- Location: India
Re: curl - Need Help
Hi it work,
Last edited by jaiswarvipin on Tue Sep 22, 2009 10:58 am, edited 1 time in total.
Re: curl - Need Help
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.
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.
-
jaiswarvipin
- Forum Commoner
- Posts: 32
- Joined: Sat Sep 12, 2009 3:43 pm
- Location: India
Re: curl - Need Help
very true,
Last edited by jaiswarvipin on Tue Sep 22, 2009 10:59 am, edited 1 time in total.
Re: curl - Need Help
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.
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.
-
jaiswarvipin
- Forum Commoner
- Posts: 32
- Joined: Sat Sep 12, 2009 3:43 pm
- Location: India
Re: curl - Need Help
I have enable the Header true and found this response form server.
Last edited by jaiswarvipin on Tue Sep 22, 2009 10:59 am, edited 1 time in total.
-
jaiswarvipin
- Forum Commoner
- Posts: 32
- Joined: Sat Sep 12, 2009 3:43 pm
- Location: India
Re: curl - Need Help
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.

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.