cURL NOBODY实际上是抓取身体吗? [英] Does cURL NOBODY actually fetch the body?

查看:398
本文介绍了cURL NOBODY实际上是抓取身体吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这个函数在CURL只是剥离响应体,但仍然加载它。
是真的吗?我不想浪费带宽,我只想要标头。

I'm not sure if this function in CURL just strips the response body out but still load it fully. Is that true? I don't want to waste bandwidth, I just want the headers.

推荐答案

CURLOPT_NOBODY 将向Web服务器发送一个 HEAD 请求。服务器应该只使用HTTP头部而不使用正文内容。

CURLOPT_NOBODY will send a HEAD request to web server. The server should respond with just the HTTP headers and no body content.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html


HEAD方法与GET相同,只是服务器不能在响应中返回消息体。

The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.

这篇关于cURL NOBODY实际上是抓取身体吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆