curl:无法识别 URI 前缀



当我想检查我的端口时,它只允许我的第 80 个端口。我也尝试过 http://。是一样的。我无法检查特定端口。检查屏幕截图。我的操作系统是Windows 10 Pro,这是Powershell。我也在CMD上检查过。我正在共享代码和图像,其中包括我的代码。

curl localhost  /* ( It shows the information as in image, there is no problem with default port 80) */
curl localhost: 8080  //(httpd's port as i assigned)
curl: The URI prefix is not recognized.
curl localhost: 3306 // (mysql's port as i assigned)
curl: The URI prefix is not recognized.

在此处输入图像描述

正确调用curl需要在 URL 中包含协议标识符,并且端口需要用冒号附加到主机名,没有空格。例如,要访问本地主机上的 HTTP 服务器(通过端口 8080 提供服务(,您需要使用:

curl http://localhost:8080

在 Windows 上使用 curl.exe 本地主机:8080

如果您在minikube中遇到类型nodeport的问题,并且您使用的是Windows操作系统

使用这两个命令

minikube service list
curl.exe http://URL_SECTION_IP:EXPOSED nodeport

最新更新