Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _isCurl() {
- return function_exists('curl_version');
- }
- $ch = curl_init("URL_PARA_CONECTAR");
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- ...
- ...
- $data = curl_exec($ch);
- $response = json_decode($data, true); // o true indica que você quer o resultado como array
- $valoresParaSubmeter = array('key1' => 'valor1', 'key2' => 'valor2');
- $ch = curl_init("URL_PARA_CONECTAR");
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $valoresParaSubmeter);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- $data = curl_exec($ch);
- $response = json_decode($data, true); // o true indica que você quer o resultado como array
- var_dump($response);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement