Skip to main content

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

A lot easier to work with in scripts, as it doesn't require any parsing :-)

The parameter -I might be added to improve response load performance. This will change the call to a HEAD call which will fetch response overhead only, without the body.

Note: %{http_code} returns on first line of HTTP payload (available variables for the -w option on the curl documentation page)

i.e.:

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

A lot easier to work with in scripts, as it doesn't require any parsing :-)

The parameter -I might be added to improve response load performance. This will change the call to a HEAD call which will fetch response overhead only, without the body.

Note: %{http_code} returns on first line of HTTP payload (available variables)

i.e.:

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

A lot easier to work with in scripts, as it doesn't require any parsing :-)

The parameter -I might be added to improve response load performance. This will change the call to a HEAD call which will fetch response overhead only, without the body.

Note: %{http_code} returns on first line of HTTP payload (available variables for the -w option on the curl documentation page)

i.e.:

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

A lot easier to work with in scripts, as it doesn't require any parsing :-)

The parameter -I might be added to improve response load performance. This will change the call to a HEAD call which will fetch response overhead only, without the body.

Note: %{http_code} returns on first line of HTTP payload (available variables)

i.e.:

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

A lot easier to work with in scripts, as it doesn't require any parsing :-)

The parameter -I might be added to improve response load performance. This will change the call to a HEAD call which will fetch response overhead only, without the body.

Note: %{http_code} returns on first line of HTTP payload

i.e.:

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

A lot easier to work with in scripts, as it doesn't require any parsing :-)

The parameter -I might be added to improve response load performance. This will change the call to a HEAD call which will fetch response overhead only, without the body.

Note: %{http_code} returns on first line of HTTP payload (available variables)

i.e.:

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

A lot easier to work with in scripts, as it doesn't require any parsing :-)

The parameter -I might be added to improve response load performance. This parameter just request for status/headers ofwill change the call to a HEAD call which will fetch response overhead only, without download responsethe body.

Note: %{http_code} returns on first line of HTTP payload

i.e.:

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

A lot easier to work with in scripts, as it doesn't require any parsing :-)

The parameter -I might be added to improve response load performance. This parameter just request for status/headers of response, without download response body.

Note: %{http_code} returns on first line of HTTP payload

i.e.:

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}" http://www.example.org/

A lot easier to work with in scripts, as it doesn't require any parsing :-)

The parameter -I might be added to improve response load performance. This will change the call to a HEAD call which will fetch response overhead only, without the body.

Note: %{http_code} returns on first line of HTTP payload

i.e.:

curl -s -o /dev/null -I -w "%{http_code}" http://www.example.org/
Just added -I parameter to improve response load performance.
Source Link
Loading
Source Link
pvandenberk
  • 14.8k
  • 2
  • 14
  • 3
Loading