src/Jira/Api.php
public function api(
		$method = self::REQUEST_GET,
		$url,
		$data = array(),
		$return_as_array = false,
		$is_file = false,
		$debug = false
	) {
		$result = $this->client->sendRequest(
			$method,
			$url,
			$data,
			$this->getEndpoint(),
			$this->authentication,
			$is_file,
			$debug
		);

		if ( strlen($result) ) {
			$json = json_decode($result, true);

			if ( $this->options & self::AUTOMAP_FIELDS ) {
				if ( isset($json['issues']) ) {
					if ( $this->fields === null ) {
						$this->getFields();
					}

					foreach ( $json['issues'] as $offset => $issue ) {
						$json['issues'][$offset] = $this->automapFields($issue);
					}
				}
			}

			if ( $return_as_array ) {
				return $json;
			}
			else {
				return new Result($json);
			}
		}
		else {
			return false;
		}
	}
public function api(
		$method = self::REQUEST_GET,
		$url,
		$data = array(),
		$return_as_array = false,
		$is_file = false,
		$debug = false
	) {
		$result = $this->client->sendRequest(
			$method,
			$url,
			$data,
			$this->getEndpoint(),
			$this->authentication,
			$is_file,
			$debug
		);

		if ( strlen($result) ) {
			$json = json_decode($result, true);

			if ( $this->options & self::AUTOMAP_FIELDS ) {
				if ( isset($json['issues']) ) {
					if ( $this->fields === null ) {
						$this->getFields();
					}

					foreach ( $json['issues'] as $offset => $issue ) {
						$json['issues'][$offset] = $this->automapFields($issue);
					}
				}
			}

			if ( $return_as_array ) {
				return $json;
			}
			else {
				return new Result($json);
			}
		}
		else {
			return false;
		}
	}
public function api ( $ method = self :: REQUEST_GET , $ url , $ data = array ( ) , $ return_as_array = false , $ is_file = false , $ debug = false ) { $ result = $ this -> client -> sendRequest ( $ method , $ url , $ data , $ this -> getEndpoint ( ) , $ this -> authentication , $ is_file , $ debug ) ; if ( strlen ( $ result ) ) { $ json = json_decode ( $ result , true ) ; if ( $ this -> options & self :: AUTOMAP_FIELDS ) { if ( isset ( $ json [ 'issues' ] ) ) { if ( $ this -> fields === null ) { $ this -> getFields ( ) ; } foreach ( $ json [ 'issues' ] as $ offset => $ issue ) { $ json [ 'issues' ] [ $ offset ] = $ this -> automapFields ( $ issue ) ; } } } if ( $ return_as_array ) { return $ json ; } else { return new Result ( $ json ) ; } } else { return false ; } }
Send request to specified host.

@param string       $method          Request method.
@param string       $url             URL.
@param array|string $data            Data.
@param boolean      $return_as_array Return results as associative array.
@param boolean      $is_file         Is file-related request.
@param boolean      $debug           Debug this request.

@return array|Result|false
Send request to specified host .