Files
FixIt/layouts/partials/function/get-remote-json.html
T

14 lines
407 B
HTML

{{- $response := dict -}}
{{- $options := .OPTIONS | default dict -}}
{{- with resources.GetRemote .URL $options -}}
{{- with .Err -}}
{{- erroridf "error-get-remote-json" "%s" . -}}
{{- else -}}
{{- $response = .Content | transform.Unmarshal -}}
{{- end -}}
{{- else -}}
{{- erroridf "error-get-remote-json" "Unable to get remote resource %q" .URL -}}
{{- end -}}
{{- return $response -}}