Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get only response headers from XMLHttpRequest

Is it possible to get only response headers from XMLHttpRequest without downloading file data?

like image 441
Anton Avatar asked Oct 16 '25 12:10

Anton


1 Answers

If the server you are making the request to supports the method, it sounds like what you want is to make an HTTP HEAD request. See the HTTP spec.

For example compare the output from curl -v -X GET https://github.com and curl -v -X HEAD https://github.com.

Also see HTTP HEAD Request in Javascript/Ajax?

like image 132
Stephen Ierodiaconou Avatar answered Oct 18 '25 02:10

Stephen Ierodiaconou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!