小编sor*_*ush的帖子

仅从 curl 命令返回 HTTP 状态代码

我只想从CURL命令响应中获取一个 statusCode 。

当我使用此命令时:

curl -I  http://uploadserver.ln/1.mp4
Run Code Online (Sandbox Code Playgroud)

我只想得到200而不是这个长结果:

HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Date: Sun, 01 Jul 2018 12:47:02 GMT
Content-Type: video/mp4
Content-Length: 1055736
Last-Modified: Sat, 30 Jun 2018 07:58:25 GMT
Connection: keep-alive
ETag: "5b373821-101bf8"
Accept-Ranges: bytes
Run Code Online (Sandbox Code Playgroud)

谁能帮我?

command-line-interface command curl

14
推荐指数
1
解决办法
2万
查看次数

标签 统计

command ×1

command-line-interface ×1

curl ×1