ReferenceScripting APIMotionScenefetch
MotionScene.fetch
methodReads a web address on one of the sites the scene may read (Websites it may read, on the Scene's Script card), when the person allows it.
| Name | fetch |
|---|---|
| Kind | method of MotionScene |
| Called as | scene.fetch(…) |
| As a node | Send HTTP Request (logic graph) |
| Since | 0.3 |
Syntax
fetch( url: string, options?: { method?: "GET" | "POST" | "HEAD"; headers?: Record<string, string>; body?: unknown }): Promise<MotionFetched>Parameters
| Name | Type | Description |
|---|---|---|
url | string | An https:// address |
options | { method?: "GET" | "POST" | "HEAD"; headers?: Record<string, string>; body?: unknown } | Optional. Its method (GET, POST, HEAD), headers and body |
Returns
Promise<MotionFetched>: a promise of what it answered.
Remarks
Rejects for an address the scene doesn't name or the person doesn't allow, one on this computer or its network, more than 30 a minute, and answers over 4 MB.
Example
const r = await scene.fetch("https://api.example.com/quote");See also
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.