@@ -66,7 +66,9 @@ discard block |
||
| 66 | 66 | curl_setopt($curl, CURLOPT_POSTFIELDS, $param); |
| 67 | 67 | |
| 68 | 68 | /** 设置请求headers */ |
| 69 | - if(empty($httpHeaders)) $httpHeaders = self::$httpHeaders; |
|
| 69 | + if(empty($httpHeaders)) { |
|
| 70 | + $httpHeaders = self::$httpHeaders; |
|
| 71 | + } |
|
| 70 | 72 | curl_setopt($curl, CURLOPT_HTTPHEADER, $httpHeaders); |
| 71 | 73 | |
| 72 | 74 | /** gzip压缩 */ |
@@ -100,14 +102,14 @@ discard block |
||
| 100 | 102 | throw new TException(StatusCode::COMMON_TINYMENG_REQUEST_METHOD, |
| 101 | 103 | '[httpPost]: POST request was aborted ! Request url :' . $url . ' , post request data : ' . var_export($param,true) |
| 102 | 104 | ); |
| 103 | - }elseif(intval($info["http_code"]) != $http_code){ |
|
| 105 | + } elseif(intval($info["http_code"]) != $http_code){ |
|
| 104 | 106 | throw new TException(StatusCode::COMMON_TINYMENG_REQUEST_METHOD, |
| 105 | 107 | '[httpPost]: POST request was aborted ! Request url :' . $url . ' , post request data : ' . var_export($param,true).' ,return code : '.$info["http_code"] .' ,return content : '.$content |
| 106 | 108 | ); |
| 107 | 109 | } else { |
| 108 | 110 | return $content; |
| 109 | 111 | } |
| 110 | - }else{ |
|
| 112 | + } else{ |
|
| 111 | 113 | return $content; |
| 112 | 114 | } |
| 113 | 115 | } |
@@ -154,7 +156,9 @@ discard block |
||
| 154 | 156 | } |
| 155 | 157 | |
| 156 | 158 | /** 设置请求headers */ |
| 157 | - if(empty($httpHeaders)) $httpHeaders = self::$httpHeaders; |
|
| 159 | + if(empty($httpHeaders)) { |
|
| 160 | + $httpHeaders = self::$httpHeaders; |
|
| 161 | + } |
|
| 158 | 162 | curl_setopt($curl, CURLOPT_HTTPHEADER, $httpHeaders); |
| 159 | 163 | |
| 160 | 164 | /** gzip压缩 */ |
@@ -173,14 +177,14 @@ discard block |
||
| 173 | 177 | throw new TException(StatusCode::COMMON_TINYMENG_REQUEST_METHOD, |
| 174 | 178 | '[httpGet]: GET request was aborted ! Request url :' . $url |
| 175 | 179 | ); |
| 176 | - }elseif(intval($info["http_code"]) != $http_code){ |
|
| 180 | + } elseif(intval($info["http_code"]) != $http_code){ |
|
| 177 | 181 | throw new TException(StatusCode::COMMON_TINYMENG_REQUEST_METHOD, |
| 178 | 182 | '[httpGet]: GET request was aborted ! Request url :' . $url .' ,return code : '.$info["http_code"] .' ,return content : '.$content |
| 179 | 183 | ); |
| 180 | 184 | } else { |
| 181 | 185 | return $content; |
| 182 | 186 | } |
| 183 | - }else{ |
|
| 187 | + } else{ |
|
| 184 | 188 | return $content; |
| 185 | 189 | } |
| 186 | 190 | } |