49 lines
1.5 KiB
PHP
49 lines
1.5 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class Welcome extends CI_Controller {
|
|
|
|
public function index(){
|
|
echo '404';exit;
|
|
//生产地址
|
|
$url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue';
|
|
//测试地址
|
|
$url = 'https://salesapp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue';
|
|
|
|
$data[] = array(
|
|
'cusSource3' => "010403",
|
|
'customerName' => "测试A",
|
|
'dealerCode' => "100316",
|
|
'fromSystem' => "好店云",
|
|
'mobile' => "13012341234",
|
|
'remark' => "测试数据",
|
|
);
|
|
|
|
$data = json_encode($data, JSON_UNESCAPED_UNICODE);
|
|
|
|
$ch = curl_init();
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
//https
|
|
if (strlen($url) > 5 && strtolower(substr($url, 0, 5)) == "https") {
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
}
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
|
'Content-Type: application/json; charset=utf-8',
|
|
'Content-Length: ' . strlen($data)
|
|
)
|
|
);
|
|
$response = curl_exec($ch);
|
|
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
|
curl_close($ch);
|
|
|
|
var_dump($response);
|
|
}
|
|
}
|
|
|
|
|
|
|