TechEmpower/FrameworkBenchmarks — pull request #567 by MalcolmEvershed (2013-10-25 22:58:06+00:00)
Title: During verify, show HTTP headers, and during errors show HTTP response

To help with #373 and to more easily diagnose problems: Call curl twice, once to get full HTTP output including headers and again to throw an error if an HTTP error occurs.

Here's stdout when the webserver returns a successful HTTP response:

VERIFYING Plaintext (/plaintext) ...
HTTP/1.1 200 OK
Content-Length: 13
Content-Type: text/plain; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 25 Oct 2013 22:44:30 GMT

Hello, World!

Here's the combined stderr/stdout when the webserver returns an error:

VERIFYING JSON (/json) ...
HTTP/1.1 404 Not Found
Content-Length: 9
Content-Type: text/plain; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 25 Oct 2013 22:44:30 GMT

not found
curl: (22) The requested URL returned error: 404 Not Found

Here's the combined stderr/stdout when the webserver isn't running:

VERIFYING JSON (/json) ...
curl: (7) Failed connect to 192.168.1.140:8080; No error