首页 > 解决方案 > 您可以使用例如 nc 或 wget 而不使用 curl 来发出 http 请求吗?(忙箱)

问题描述

我目前在 Kubernetes Pod 中使用了一个 busybox,并希望让这个容器(busybox)像这样运行一个 http 删除请求:

while true; do curl -X DELETE https://blabla.com/api/v1/messages; sleep 604800; done

由于 curl 不起作用(在图像中不可用)但 nc 和 wget 会起作用,有没有一种在这种情况下使用它们的好方法?

标签: curlhttprequestnetcatbusybox

解决方案


得到:

 wget --method=DELETE https://blabla.com/api/v1/messages

在标准输出中得到结果,比如在 curl

wget -q -O - --method=DELETE http://localhost:8080

推荐阅读