api() public method

Send request to specified host.
public api ( string $method = self::REQUEST_GET, string $url, array | string $data = [], boolean $return_as_array = false, boolean $is_file = false, boolean $debug = false ) : array | Result | false
$method string Request method.
$url string URL.
$data array | string Data.
$return_as_array boolean Return results as associative array.
$is_file boolean Is file-related request.
$debug boolean Debug this request.
return array | chobie\Jira\Api\Result | false
Example #1
0
 /**
  * Make API request
  *
  * @param string $method
  * @param string $url
  * @param array  $data
  * @param bool   $asJson
  * @param bool   $isFile
  * @param bool   $debug
  * @return JiraLib\Api\Result
  */
 public function api($method = Api::REQUEST_GET, $url = '', $data = array(), $asJson = false, $isFile = false, $debug = false)
 {
     $result = parent::api($method, $url, $data, true, $isFile, $debug);
     if ($result) {
         $this->processErrors($result);
         if (!$asJson) {
             $result = new Api\Result($result);
         }
     }
     return $result;
 }