Questions tagged [http-head]
54 questions
159
votes
8 answers
http HEAD vs GET performance
I am setting-up a REST web service that just need to answer YES or NO, as fast as possible.
Designing a HEAD service seems the best way to do it but I would like to know if I will really gain some time versus doing a GET request.
I suppose I gain…

Asterius
- 2,180
- 2
- 19
- 27
92
votes
15 answers
Checking if a website is up via Python
By using python, how can I check if a website is up? From what I read, I need to check the "HTTP HEAD" and see status code "200 OK", but how to do so ?
Cheers
Related
How do you send a HEAD HTTP request in Python?

Hellnar
- 62,315
- 79
- 204
- 279
41
votes
2 answers
Respond to HTTP HEAD requests using ASP.NET MVC
I'd like to correctly support the HTTP HEAD request when bots hit my ASP.NET MVC site using HEAD. It was brought to my attention that all HTTP HEAD requests to the site were returning 404s, particularly from http://downforeveryoneorjustme.com. Which…

DavGarcia
- 18,540
- 14
- 58
- 96
12
votes
1 answer
cURL hanging for 15 seconds when sending HEAD requests
Background
I've been timing some HTTP requests via the CLI using time and tools such as wget and curl as follows:
/usr/bin/time -v wget --spider http://localhost/index
/usr/bin/time -v curl http://localhost/index 2>&1 > /dev/null
What I noticed is…

Max
- 12,794
- 30
- 90
- 142
11
votes
5 answers
Is the HEAD response faster than the GET?
I'm currently getting the info about the files with GET, will it be faster if I rewrite it using HEAD request? Cause I close the connection after the first response.

blez
- 4,939
- 5
- 50
- 82
10
votes
2 answers
Correct response to HTTP HEAD Request on HTTPS only site
We have an ASP.Net MVC3 site only accessible over HTTPS, by using the RequireHTTPS attribute on the controller.
We are receiving numerous HTTP HEAD method requests, mainly from what appear to be Twitter bots. The default ASP.Net/MVC3 response is a…

Chris
- 101
- 1
- 3
9
votes
1 answer
Cloudfront always miss HEAD request. Why?
I am sending an ajax HEAD request to a file served over CloudFront. The max-age set for this file in S3 is 1800. Always it miss the cache in CloudFront.
Is this the expected behavior? Or is there anything has to be configured so that the HEAD…

Manu
- 4,101
- 1
- 17
- 23
7
votes
2 answers
expectHEAD is documented but not implemented?
In our internal angularjs project, one of the services has $http.head() call which I'm trying to test.
For testing, I'm using Fake HTTP backend provided by angular-mocks. Here is the relevant code:
it('handle status code 200', inject(function…

alecxe
- 462,703
- 120
- 1,088
- 1,195
6
votes
1 answer
HttpHead in ASP.NET Core
In my ASP.NET core Controller I've got the following HttpGet-function:
[HttpGet("[action]")]
[HttpHead("[action]")]
[ResponseCache(NoStore = true)]
public async Task GetProofPdf(long studentid)
{
var rawPdfData = await…

Sam
- 28,421
- 49
- 167
- 247
5
votes
1 answer
Why would a server disallow HTTP HEAD?
I found out that there are servers that respond with HTTP 405 to HEAD requests (or another status code including 404 which is confusing IMO, but that's not important now) even though GET requests are responded with HTTP 200. HTTP 405 is defined…

geckon
- 8,316
- 4
- 35
- 59
5
votes
4 answers
What is the difference between PING and HTTP HEAD?
I have an domain name to test.
Ping is ~20 ms.
'HTTP HEAD' is ~500 ms.
Why there are so big difference between them? Is this a server-side problem? Isn't there are too big difference? 25 times.

user3239600
- 321
- 1
- 3
- 13
5
votes
3 answers
Android: how can I make an HTTP HEAD request?
I would like to make a simple HTTP HEAD request, without keep-alive.
How can I do that in Android?

Daniele B
- 19,801
- 29
- 115
- 173
5
votes
1 answer
With HttpClient 4.3.x, executing a HttpHead for a specific URL gives NoHttpResponseException
Using the test class below, the line at ///// 1 ///// throws a NoHttpResponseException (see exception trace with logging at the end of the question). Executing any of the other lines ///// 2-to-8 ///// prints out the headers fine. Is this a bug in…

cosjav
- 2,095
- 1
- 17
- 17
4
votes
3 answers
Ping vs HTTP HEAD
I'm writing a Java app which has a feature to check whether it's connected to the internet by periodically trying to access a server. My first idea was to Ping the server - but turned out to be complicated to achieve in Java. So I remade it to send…

Olbion
- 113
- 1
- 12
4
votes
3 answers
C - How can I extract numbers from a char buffer?
My code sends a HTTP HEAD request to a website. The website then replies with its information. How can I extract the status code from the first line in the reply? the status code is the value after "HTTP/1.0" it is either 2xx or 3xx.
code:
#define…

nanjero echizen
- 241
- 1
- 5
- 14