Web requests in vanilla Scratch 3.0
- Create a certificate. Name it
server.crtwith the key file namedserver.key. - Install the
requirements.txtdependencies - 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 interpret the text and language to make a web request.

- Import the
translateextension to the project. - Translate text in the following format:
https://example.com|body
^^ ^^
URL Body
If applicable;
Leave empty
if not used
(Keep the |)
- To one of these languages:
| Language | Method | Uses Body? |
|---|---|---|
| Amharic | GET | No |
| Arabic | POST | Yes |
| Azerbaijani | PUT | Yes |
| Basque | DELETE | No |
| Bulgarian | PATCH | Yes |
| Catalan | OPTIONS | No |
- The response will be in this format:
status|filetype|body <- Body
^^ ^^<< Filetype
Status code h = Html
c = Css
t = plainText
i = Image (base64 encoded)
d = Data (lowercase hex encoded)
n = http (Network) header
j = Json
- Translate text in the following format:
wss://example.com|data
^^ ^^
URL Data to send
- Language is irrelevant.
- The response will be in this format:
response
^^
Server response