Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'

This commit is contained in:
Bjørn Erik Pedersen
2025-02-13 10:40:34 +01:00
817 changed files with 5301 additions and 14766 deletions

View File

@@ -17,6 +17,7 @@ The `Data` method on a resource returned by the [`resources.GetRemote`] function
```go-html-template
{{ $url := "https://example.org/images/a.jpg" }}
{{ $opts := dict "responseHeaders" (slice "Server") }}
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ errorf "%s" . }}
@@ -24,6 +25,7 @@ The `Data` method on a resource returned by the [`resources.GetRemote`] function
{{ with .Data }}
{{ .ContentLength }} → 42764
{{ .ContentType }} → image/jpeg
{{ .Headers }} → map[Server:[Netlify]]
{{ .Status }} → 200 OK
{{ .StatusCode }} → 200
{{ .TransferEncoding }} → []
@@ -34,19 +36,30 @@ The `Data` method on a resource returned by the [`resources.GetRemote`] function
{{ end }}
```
ContentLength
: (`int`) The content length in bytes.
###### ContentLength
ContentType
: (`string`) The content type.
(`int`) The content length in bytes.
Status
: (`string`) The HTTP status text.
###### ContentType
StatusCode
: (`int`) The HTTP status code.
(`string`) The content type.
TransferEncoding
: (`string`) The transfer encoding.
###### 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
(`string`) The HTTP status text.
###### StatusCode
(`int`) The HTTP status code.
###### TransferEncoding
(`string`) The transfer encoding.
[`resources.GetRemote`]: /functions/resources/getremote/