includes/eduadmin-api-client/rest-client.php
private function make_request( $type, $endpoint, $params, $method_name, $is_json = true ) {
		$t = EDUAPI()->start_timer( $method_name . ' - ' . $type );
		$c = $this->get_curl_object( $endpoint );

		$headers = array();
		$data    = null;

		if ( $is_json ) {
			$headers[] = 'Content-Type: application/json';
			$data      = json_encode( $params );
			$headers[] = 'Content-Length: ' . strlen( $data );
		} else {
			$data = http_build_query( $params );
		}
		$this->set_headers( $c, $headers );

		curl_setopt( $c, CURLOPT_CUSTOMREQUEST, $type );
		curl_setopt( $c, CURLOPT_POSTFIELDS, $data );

		$result = $this->execute_request( $c );
		EDUAPI()->stop_timer( $t );

		return $result;
	}
private function make_request( $type, $endpoint, $params, $method_name, $is_json = true ) {
		$t = EDUAPI()->start_timer( $method_name . ' - ' . $type );
		$c = $this->get_curl_object( $endpoint );

		$headers = array();
		$data    = null;

		if ( $is_json ) {
			$headers[] = 'Content-Type: application/json';
			$data      = json_encode( $params );
			$headers[] = 'Content-Length: ' . strlen( $data );
		} else {
			$data = http_build_query( $params );
		}
		$this->set_headers( $c, $headers );

		curl_setopt( $c, CURLOPT_CUSTOMREQUEST, $type );
		curl_setopt( $c, CURLOPT_POSTFIELDS, $data );

		$result = $this->execute_request( $c );
		EDUAPI()->stop_timer( $t );

		return $result;
	}
private function make_request ( $ type , $ endpoint , $ params , $ method_name , $ is_json = true ) { $ t = EDUAPI ( ) -> start_timer ( $ method_name . ' - ' . $ type ) ; $ c = $ this -> get_curl_object ( $ endpoint ) ; $ headers = array ( ) ; $ data = null ; if ( $ is_json ) { $ headers [ ] = 'Content-Type: application/json' ; $ data = json_encode ( $ params ) ; $ headers [ ] = 'Content-Length: ' . strlen ( $ data ) ; } else { $ data = http_build_query ( $ params ) ; } $ this -> set_headers ( $ c , $ headers ) ; curl_setopt ( $ c , CURLOPT_CUSTOMREQUEST , $ type ) ; curl_setopt ( $ c , CURLOPT_POSTFIELDS , $ data ) ; $ result = $ this -> execute_request ( $ c ) ; EDUAPI ( ) -> stop_timer ( $ t ) ; return $ result ; }
@param string $type
@param string $endpoint
@param string|array|object $params
@param string $method_name
@param bool $is_json

@return mixed
@param string $type @param string $endpoint @param string|array|object $params @param string $method_name @param bool $is_json