From 2943c031ab6137f3bc3cb2ff2da22e22b272f59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 16 Jan 2023 12:44:39 +0100 Subject: [PATCH] Add fill HTTP Response info into .Data in resources.GetRemote See #10604 --- content/en/hugo-pipes/introduction.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/content/en/hugo-pipes/introduction.md b/content/en/hugo-pipes/introduction.md index c16572e48..116523fd5 100755 --- a/content/en/hugo-pipes/introduction.md +++ b/content/en/hugo-pipes/introduction.md @@ -50,6 +50,20 @@ With `resources.GetRemote`, the first argument is a remote URL: `resources.Get` and `resources.GetRemote` return `nil` if the resource is not found. +{{< new-in "0.110.0" >}} You can get information about the HTTP Response using `.Data` in the returned `Resource`. This is especially useful for HEAD request without any body. The Data object contains: + +StatusCode +: The HTTP status code, e.g. 200 +Status +: The HTTP status text, e.g. "200 OK" +TransferEncoding +: The transfer encoding, e.g. "chunked" +ContentLength +: The content length, e.g. 1234 +ContentType +: The content type, e.g. "text/html" + + ## Copy a Resource {{< new-in "0.100.0" >}}