|
@@ -61,7 +61,7 @@ if (!function_exists('http_post')) { |
|
@@ -61,7 +61,7 @@ if (!function_exists('http_post')) { |
|
61
|
* @param type $url
|
61
|
* @param type $url
|
|
62
|
* @param type $post_data
|
62
|
* @param type $post_data
|
|
63
|
*/
|
63
|
*/
|
|
64
|
- function http_post($url, $post_data, $header = [],$is_json = true)
|
64
|
+ function http_post($url, $post_data, $header = [],$is_json = true,$timeout = 60)
|
|
65
|
{
|
65
|
{
|
|
66
|
if (empty($header)) {
|
66
|
if (empty($header)) {
|
|
67
|
$header = array(
|
67
|
$header = array(
|
|
@@ -73,6 +73,7 @@ if (!function_exists('http_post')) { |
|
@@ -73,6 +73,7 @@ if (!function_exists('http_post')) { |
|
73
|
curl_setopt($ch, CURLOPT_URL, $url);
|
73
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
74
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
74
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
|
75
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
75
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
|
76
|
+ curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
|
|
76
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
77
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
77
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
78
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
|
78
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
|
79
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
|