Answers for "how to get value passed via post using curl in php"

5

php curl post json

$ch = curl_init( $url );
# Setup request to send json via POST.
$payload = json_encode( array( "customer"=> $data ) );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
# Return response instead of printing.
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
# Send request.
$result = curl_exec($ch);
curl_close($ch);
Posted by: Guest on July-05-2021
0

php curl get body response

curl_setopt($ch, CURLOPT_HEADER, false);
Posted by: Guest on December-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language