HTTP GET requests in vanilla Scratch 3.0
- Create a certificate. Name it
server.crtwith the key file namedserver.key. - Install the following dependencies:
flaskrequestspillow - Simply add
127.0.0.1 translate-service.scratch.mit.eduto your hosts file (on windows -untested on linuxLinux works too - untested on macOS) - Run
server.py - Add a security exception for
translate-service.scratch.mit.eduin your browser; the certificate is self-signed, and therefore, insecure
When the translate feature is used in scratch, It sends an HTTP GET request to "translate-service.scratch.mit.edu".

Route the "translate-service.scratch.mit.edu" to localhost in the hosts file.

Create a custom script to take the parameters that Scratch sends and use the string parameter as the url to return the content of.

Now supporting all of the following request methods:
- GET
- POST
- PUT
- DELETE
- PATCH
https://example.com|body
^^ ^^
URL Body
If applicable;
Leave empty
if not used
(Keep the |)
200|filetype|body <- Body
^ ^^<< Filetype
Status code h = Html
c = Css
t = plainText
i = Image (base64 encoded)
d = Data (lowercase hex encoded)
Change the target language to select the request method:
| Language | Request | Uses Body? |
|---|---|---|
| Amharic | GET | No |
| Arabic | POST | Yes |
| Azerbaijani | PUT | Yes |
| Basque | DELETE | No |
| Bulgarian | PATCH | Yes |
| Zulu | [Dummy Request] | No |
- The Dummy Request can be used as a "padding" between requests, in case Scratch's caching system is causing unexpected behavior.
Audio is not natively supported anymore. Please use something like this to play audio.
ScratchHTTP can convert image files to a Scratch-friendly base64 format.
See image-client.sb3 for an example.