mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-14 09:04:41 -04:00
Add fill HTTP Response info into .Data in resources.GetRemote
See #10604
This commit is contained in:
parent
e033dbeadc
commit
2943c031ab
@ -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.
|
`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
|
## Copy a Resource
|
||||||
|
|
||||||
{{< new-in "0.100.0" >}}
|
{{< new-in "0.100.0" >}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user