Post data and retrieve the response using PHP Curl? -


i'm new working web services, , i'm finding pretty confusing.

if have url i'm trying post json data to, understand how using curl php method.

what i'm wondering is, if this, , url has kind of server response.. how response in php , use take different actions within php accordingly?

thanks!

-elliot

you'll have set curlopt_returntransfer option true.

$ch = curl_init($url);  curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $params); curl_setopt($ch, curlopt_returntransfer, true); $result = curl_exec($ch);  curl_close($ch); 

the response request available in $result variable.


Comments

Popular posts from this blog

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

Disabling Android home button for industry application -

asp.net mvc 3 - Unexpected "foreach" keyword after "@" character -