Set cURL options

such as delegate, follow location, URL, user agent and address family

Property definitions

curl $ CurlHTTPRequest :: set_curl_options
	# Set cURL options
	# such as delegate, follow location, URL, user agent and address family
	private fun set_curl_options : CURLCode
	do
		var err

		err = self.curl.native.easy_setopt(new CURLOption.follow_location, 1)
		if not err.is_ok then return err

		err = self.curl.native.easy_setopt(new CURLOption.url, url)
		if not err.is_ok then return err

		var user_agent = user_agent
		if user_agent != null then
			err = curl.native.easy_setopt(new CURLOption.user_agent, user_agent)
			if not err.is_ok then return err
		end

		var unix_socket_path = unix_socket_path
		if unix_socket_path != null then
			err = self.curl.native.easy_setopt(new CURLOption.unix_socket_path, unix_socket_path)
			if not err.is_ok then return err
		end
		return err
	end
lib/curl/curl.nit:223,2--247,4