Cloudinary\Curl::http_method PHP Method

http_method() public method

public http_method ( )
    public function http_method()
    {
        if (array_key_exists(CURLOPT_CUSTOMREQUEST, $this->parameters)) {
            return Curl::$instance->getopt(CURLOPT_CUSTOMREQUEST);
        } else {
            $method_array = array_keys(array_intersect_key($this->parameters, array("CURLOPT_POST" => 0, "CURLOPT_PUT" => 0, "CURLOPT_HTTPGET" => 0)));
            if (count($method_array) > 0) {
                return preg_replace("/CURLOPT_(HTTP)?/", "", $method_array[0]);
            } else {
                return "POST";
            }
        }
    }