mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -3,18 +3,18 @@ title: Data
|
||||
description: Applicable to resources returned by the resources.GetRemote function, returns information from the HTTP response.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/resources/GetRemote
|
||||
- methods/resource/Err
|
||||
returnType: map
|
||||
signatures: [RESOURCE.Data]
|
||||
params:
|
||||
functions_and_methods:
|
||||
returnType: map
|
||||
signatures: [RESOURCE.Data]
|
||||
---
|
||||
|
||||
The `Data` method on a resource returned by the [`resources.GetRemote`] function returns information from the HTTP response.
|
||||
|
||||
[`resources.GetRemote`]: /functions/resources/getremote/
|
||||
|
||||
## Example
|
||||
|
||||
```go-html-template
|
||||
{{ $url := "https://example.org/images/a.jpg" }}
|
||||
{{ $opts := dict "responseHeaders" (slice "Server") }}
|
||||
@@ -36,30 +36,31 @@ The `Data` method on a resource returned by the [`resources.GetRemote`] function
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
###### ContentLength
|
||||
## Methods
|
||||
|
||||
### ContentLength
|
||||
|
||||
(`int`) The content length in bytes.
|
||||
|
||||
###### ContentType
|
||||
### ContentType
|
||||
|
||||
(`string`) The content type.
|
||||
|
||||
###### Headers
|
||||
### Headers
|
||||
|
||||
(`map[string][]string`) A map of response headers matching those requested in the [`responseHeaders`] option passed to the `resources.GetRemote` function. The header name matching is case-insensitive. In most cases there will be one value per header key.
|
||||
|
||||
[`responseHeaders`]: /functions/resources/getremote/#responseheaders
|
||||
|
||||
###### Status
|
||||
### Status
|
||||
|
||||
(`string`) The HTTP status text.
|
||||
|
||||
###### StatusCode
|
||||
### StatusCode
|
||||
|
||||
(`int`) The HTTP status code.
|
||||
|
||||
###### TransferEncoding
|
||||
### TransferEncoding
|
||||
|
||||
(`string`) The transfer encoding.
|
||||
|
||||
[`resources.GetRemote`]: /functions/resources/getremote/
|
||||
[`responseHeaders`]: /functions/resources/getremote/#responseheaders
|
||||
|
Reference in New Issue
Block a user