@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | private function makeRequest($method, $args = array()) { |
| 44 | 44 | |
| 45 | - $url = $this->api_endpoint . '/' . $method . '.json'; |
|
| 45 | + $url = $this->api_endpoint.'/'.$method.'.json'; |
|
| 46 | 46 | |
| 47 | 47 | if (function_exists('curl_init') && function_exists('curl_setopt')) { |
| 48 | 48 | $ch = curl_init(); |
| 49 | 49 | curl_setopt($ch, CURLOPT_URL, $url); |
| 50 | - curl_setopt($ch, CURLOPT_USERPWD, $this->username . ":" . $this->password); |
|
| 50 | + curl_setopt($ch, CURLOPT_USERPWD, $this->username.":".$this->password); |
|
| 51 | 51 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); |
| 52 | - curl_setopt($ch, CURLOPT_USERAGENT, "2Parale-" . $this->api_version); |
|
| 52 | + curl_setopt($ch, CURLOPT_USERAGENT, "2Parale-".$this->api_version); |
|
| 53 | 53 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 54 | 54 | curl_setopt($ch, CURLOPT_TIMEOUT, 10); |
| 55 | 55 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_ssl); |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | $result = file_get_contents($url, null, stream_context_create(array( |
| 65 | 65 | 'http' => array( |
| 66 | 66 | 'protocol_version' => 1.1, |
| 67 | - 'user_agent' => "2Parale-" . $this->api_version, |
|
| 67 | + 'user_agent' => "2Parale-".$this->api_version, |
|
| 68 | 68 | 'method' => 'POST', |
| 69 | - 'header' => "Authorization: Basic " . base64_encode($this->username . ':' . $this->password) . "\r\n" . |
|
| 70 | - "Content-type: application/json\r\n" . |
|
| 71 | - "Connection: close\r\n" . |
|
| 72 | - "Content-length: " . strlen($json_data) . "\r\n", |
|
| 69 | + 'header' => "Authorization: Basic ".base64_encode($this->username.':'.$this->password)."\r\n". |
|
| 70 | + "Content-type: application/json\r\n". |
|
| 71 | + "Connection: close\r\n". |
|
| 72 | + "Content-length: ".strlen($json_data)."\r\n", |
|
| 73 | 73 | 'content' => $json_data, |
| 74 | 74 | ), |
| 75 | 75 | ))); |