首页 > 解决方案 > curl: (7) 连接 127.0.0.1 端口 3000 失败:连接被拒绝

问题描述

我正在尝试通过从 sam lcoal start-api 获得的 api 发布我的图像以开始调整大小。

docker exec -it test_container curl -H "Accept: image/png" -H "Content-Type: image/png" --data-binary "cat3.png" -X POST http://127.0.0.1:3000/hello -o test.png

错误是:

curl: (7) Failed to connect to 127.0.0.1 port 3000: Connection refused

期望结果是调整图像大小。但是在这里我发现了错误。有人可以在整个过程中帮助我吗?

标签: curllocalhost

解决方案


推荐阅读