alexcrichton / curl-rust

Rust bindings to libcurl
MIT License
1.02k stars 233 forks source link

Ability to make a HEAD request #380

Closed andrewdavidmackenzie closed 3 years ago

andrewdavidmackenzie commented 3 years ago

I was interested in using curl-rust to do a HEAD request instead of GET, just to check that a resource exists but avoid retrieving the body.

I don't think that's possible now?

Would it be something interesting to add?

sagebind commented 3 years ago

As per the libcurl documentation, the option you are looking for is called CURLOPT_NOBODY, which corresponds to Easy::nobody and Easy2::nobody in the bindings.

andrewdavidmackenzie commented 3 years ago

Thanks very much - I wasn't familiar with that.