curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: Exists?

From: ToddAndMargo <ToddAndMargo_at_zoho.com>
Date: Sun, 5 Aug 2018 16:20:13 -0700

On 08/05/2018 03:44 PM, Daniel Stenberg wrote:
> On Sun, 5 Aug 2018, ToddAndMargo wrote:
>
>> Is there a way to ask curl to tell me is a url exists without
>> downloading it if it does?
>
>  curl -f http://example.com/non-exists
>

$ curl -f http://example.com/non-exists
curl: (22) The requested URL returned error: 404 Not Found

Perfect. Just look for the 404

Thank you!

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-08-06