From 668ca13a020218a91b60221ea223f64cd4db71b3 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Wed, 27 Mar 2024 14:17:43 +0100 Subject: [PATCH] Show how to make an URL HEAD request in an non-exported section --- README.org | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.org b/README.org index cce0bb3..9d84f61 100644 --- a/README.org +++ b/README.org @@ -6952,6 +6952,50 @@ GET https://pypi.org/simple/numpy Accept: application/vnd.pypi.simple.latest+json #+end_src +*** [[info:url#Top][URL (info)]] :noexport: +:PROPERTIES: +:CUSTOM_ID: sec:url +:END: + +[[https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00670.html][How to retrieve only URL metadata]] + +#+caption[Make an URL HEAD request]: +#+caption: Make an URL HEAD request. +#+name: lst:url-head-request +#+header: :wrap "src text -n :eval no" +#+begin_src emacs-lisp -n :eval never-export :exports both :tangle no +(with-current-buffer + (let ((url-request-method "HEAD")) + (url-retrieve-synchronously "https://www.gnu.org/")) + (buffer-string)) +#+end_src + +#+caption[URL HEAD request result]: +#+caption: URL HEAD request result. +#+name: lst:url-head-request-result +#+RESULTS: lst:url-head-request +#+begin_src text -n :eval no +HTTP/1.1 200 OK +Date: Wed, 27 Mar 2024 07:40:07 GMT +Server: Apache/2.4.29 +Content-Location: home.html +Vary: negotiate,accept-language,Accept-Encoding +TCN: choice +Strict-Transport-Security: max-age=63072000 +X-Frame-Options: sameorigin +X-Content-Type-Options: nosniff +Access-Control-Allow-Origin: (null) +Accept-Ranges: bytes +Cache-Control: max-age=0 +Expires: Wed, 27 Mar 2024 07:40:07 GMT +Content-Length: 9803 +Keep-Alive: timeout=5, max=100 +Connection: Keep-Alive +Content-Type: text/html +Content-Language: en + +#+end_src + *** [[https://www.emacswiki.org/emacs/WebJump][Webjump]] :PROPERTIES: :CUSTOM_ID: sec:webjump