GNU/Linux >> Belajar Linux >  >> Linux

Dapatkan informasi tajuk dengan cURL

Ada banyak alat online tempat Anda dapat menguji tajuk situs web Anda. Tetapi ada cara sederhana untuk memeriksa tajuk untuk satu situs dengan alat lokal – cURL . curl (URL Klien) adalah alat untuk mentransfer informasi melalui berbagai protokol.

Dalam kasus kami, kami akan menggunakannya untuk mendapatkan tajuk untuk situs tertentu. Perintahnya adalah:

# curl -L -I domain.com
-L, --location	- cURL will follow any redirections
-I, --head	- cURL will get only the headers of the document

Contoh untuk nama domain kami disajikan di bawah ini. Anda melihat bahwa alat ini hanya mendapatkan header dan juga mengikuti pengalihan dari plothost.com ke https://www.plothost.com

root@web [~]# curl -L -I plothost.com
HTTP/1.1 301 Moved Permanently
Date: Wed, 13 May 2020 17:14:14 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Location: https://www.plothost.com/
Cache-Control: max-age=3600
Expires: Wed, 13 May 2020 18:14:14 GMT
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 OK
Date: Wed, 13 May 2020 17:14:15 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Last-Modified: Wed, 13 May 2020 16:43:54 GMT
ETag: "be9b-5a58a49253bdc"
Accept-Ranges: bytes
Content-Length: 48795
Cache-Control: max-age=10800, must-revalidate, public
Expires: Wed, 13 May 2020 17:43:54 GMT
Vary: Accept-Encoding,Cookie
Connection: keep-alive
Set-Cookie: HttpOnly;Secure
X-XSS-Protection: 1; mode=block
Referrer-Policy: no-referrer-when-downgrade
Expect-CT: enforce;max-age=30; report-uri https://plothost.report-uri.io/r/default/ct/enforce
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Feature-Policy: accelerometer none;ambient-light-sensor none;autoplay none;camera none;geolocation none;gyroscope none;magnetometer none;microphone none;midi none;usb none;vibrate none;wake-lock none;xr-spatial-tracking none
Access-Control-Allow-Origin: *
Pragma: public
Content-Type: text/html; charset=UTF-8

root@web [~]#

Sumber daya:

halaman manual cURL


Linux
  1. Diurutkan dengan sort di baris perintah

  2. Mulai dengan Server Cloud

  3. Memulai Tasksel di Debian

  1. Mulailah dengan Lateks di Linux

  2. Bagaimana cara mendapatkan jejak tumpukan untuk C++ menggunakan gcc dengan informasi nomor baris?

  3. Menyalahgunakan cURL untuk berkomunikasi dengan Redis

  1. Memulai NetworkManager di Linux

  2. 10 cara untuk memulai dengan Linux

  3. Cara mendapatkan statistik sistem dengan node.js