RD7
RD7

Reputation: 708

curl - know i reached html file from header

I send curl cmd from shell with --head flag:

curl -k --head http://www.something.com/whatever

is there any way to know from answer headers if this link contains html file can be shown in browser or another type of downloading file (pdf, doc, txt, etc). Thanks.

Upvotes: 0

Views: 41

Answers (1)

janos
janos

Reputation: 124646

The response header should contain a Content-Type field, for HTML files it should be:

Content-Type: text/html

See also the list of known MIME-types.

Upvotes: 1

Related Questions