TurboWarp-HTTP-Server: complete block reference
All 57 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.
set HTTP bridge URL to [URL]Sets the WebSocket URL used to reach the HTTP bridge server.
Block type: COMMAND. Opcode: setServerUrl. Permanent link
Argument Type Default value Menu choices URLSTRING ws://127.0.0.1:8787/ws
connect to HTTP bridgeOpens a WebSocket connection to the configured HTTP bridge server.
Block type: COMMAND. Opcode: connect. Permanent link
This block has no arguments.
disconnect from HTTP bridgeCloses the current bridge connection.
Block type: COMMAND. Opcode: disconnect. Permanent link
This block has no arguments.
HTTP bridge connected?Reports whether the bridge WebSocket is currently open.
Block type: BOOLEAN. Opcode: isConnected. Permanent link
This block has no arguments.
send [MESSAGE] to HTTP bridgeSends a text message to the connected HTTP bridge server.
Block type: COMMAND. Opcode: sendText. Permanent link
Argument Type Default value Menu choices MESSAGESTRING {"type":"ping"}
last HTTP bridge messageReturns the most recent text message received from the bridge.
Block type: REPORTER. Opcode: lastMessage. Permanent link
This block has no arguments.
when HTTP request receivedStarts a TurboWarp handler thread when the bridge receives an HTTP request.
Block type: HAT. Opcode: whenHttpRequestReceived. Permanent link
This block has no arguments.
use HTTP request [ID]Selects a pending request context by request ID.
Block type: COMMAND. Opcode: useHttpRequest. Permanent link
Argument Type Default value Menu choices IDSTRING req-1
current request IDReturns the current HTTP request ID.
Block type: REPORTER. Opcode: currentRequestId. Permanent link
This block has no arguments.
current HTTP methodReturns the current HTTP request method.
Block type: REPORTER. Opcode: currentHttpMethod. Permanent link
This block has no arguments.
current request pathReturns the current HTTP request path.
Block type: REPORTER. Opcode: currentRequestPath. Permanent link
This block has no arguments.
current request URLReturns the current HTTP request URL.
Block type: REPORTER. Opcode: currentRequestUrl. Permanent link
This block has no arguments.
query parameter [NAME]Returns the first query parameter value.
Block type: REPORTER. Opcode: queryParameter. Permanent link
Argument Type Default value Menu choices NAMESTRING q
path parameter [NAME]Returns a route path parameter value.
Block type: REPORTER. Opcode: pathParameter. Permanent link
Argument Type Default value Menu choices NAMESTRING id
current request bodyReturns the current textual request body, or an empty string for non-text bodies.
Block type: REPORTER. Opcode: currentRequestBody. Permanent link
This block has no arguments.
current request content typeReturns the current request Content-Type header.
Block type: REPORTER. Opcode: currentRequestContentType. Permanent link
This block has no arguments.
current request client addressReturns the current request client address when available.
Block type: REPORTER. Opcode: currentRequestClientAddress. Permanent link
This block has no arguments.
set handler variable [NAME] to [VALUE]Sets a request-local variable that is discarded when the current HTTP response completes.
Block type: COMMAND. Opcode: setHandlerVariable. Permanent link
Argument Type Default value Menu choices NAMESTRING valueVALUESTRING 0
change handler variable [NAME] by [AMOUNT]Changes a request-local numeric variable using Scratch number conversion rules.
Block type: COMMAND. Opcode: changeHandlerVariable. Permanent link
Argument Type Default value Menu choices NAMESTRING valueAMOUNTNUMBER 1
このブロックの固定入力編集と互換性
handler variable [NAME]Returns a request-local handler variable, or an empty string when it does not exist.
Block type: REPORTER. Opcode: handlerVariable. Permanent link
Argument Type Default value Menu choices NAMESTRING value
handler variable [NAME] exists?Reports whether a request-local handler variable exists.
Block type: BOOLEAN. Opcode: handlerVariableExists. Permanent link
Argument Type Default value Menu choices NAMESTRING value
delete handler variable [NAME]Deletes a request-local handler variable.
Block type: COMMAND. Opcode: deleteHandlerVariable. Permanent link
Argument Type Default value Menu choices NAMESTRING value
delete all handler variablesDeletes all request-local handler variables for the current HTTP handler.
Block type: COMMAND. Opcode: clearHandlerVariables. Permanent link
This block has no arguments.
active handler variablesReturns comma-separated names of request-local handler variables.
Block type: REPORTER. Opcode: listHandlerVariables. Permanent link
This block has no arguments.
current auth typeReturns the current authentication type, such as digest or oauth.
Block type: REPORTER. Opcode: currentAuthType. Permanent link
This block has no arguments.
current authenticated userReturns the authenticated username or a stable user-like profile field when available.
Block type: REPORTER. Opcode: currentAuthenticatedUser. Permanent link
This block has no arguments.
current auth providerReturns the authentication provider name when available.
Block type: REPORTER. Opcode: currentAuthProvider. Permanent link
This block has no arguments.
current auth profile JSONReturns the provider profile object as JSON when available.
Block type: REPORTER. Opcode: currentAuthProfileJson. Permanent link
This block has no arguments.
auth profile field [NAME]Returns a top-level or dotted field from the provider profile object.
Block type: REPORTER. Opcode: authProfileField. Permanent link
Argument Type Default value Menu choices NAMESTRING email
current response statusReturns the response status currently being built.
Block type: REPORTER. Opcode: currentResponseStatus. Permanent link
This block has no arguments.
set HTTP status [STATUS]Sets the current response status.
Block type: COMMAND. Opcode: setHttpStatus. Permanent link
Argument Type Default value Menu choices STATUSNUMBER 200
このブロックの固定入力編集と互換性
set response body [BODY]Sets the current response body without completing the response.
Block type: COMMAND. Opcode: setResponseBody. Permanent link
Argument Type Default value Menu choices BODYSTRING Hello
send response [BODY]Sets the response body and completes the current request.
Block type: COMMAND. Opcode: sendResponse. Permanent link
Argument Type Default value Menu choices BODYSTRING Hello
respond with text [BODY]Responds with plain text.
Block type: COMMAND. Opcode: respondWithText. Permanent link
Argument Type Default value Menu choices BODYSTRING Hello
respond with HTML [BODY]Responds with HTML.
Block type: COMMAND. Opcode: respondWithHtml. Permanent link
Argument Type Default value Menu choices BODYSTRING <p>Hello</p>
respond with JSON [BODY]Responds with JSON.
Block type: COMMAND. Opcode: respondWithJson. Permanent link
Argument Type Default value Menu choices BODYSTRING {"ok":true}
respond with named [NAMESPACE] [NAME] kind [KIND] scope [SCOPE] target [TARGET_ID] as [REPRESENTATION] max bytes [MAX_BYTES]Completes the response with a named structured, document, binary, or asset snapshot resolved by the server.
Block type: COMMAND. Opcode: respondWithNamedBody. Permanent link
Argument Type Default value Menu choices NAMESPACESTRING assetNAMESTRING avatarKINDSTRING assetSCOPESTRING projectTARGET_IDSTRING Stage:1REPRESENTATIONSTRING rawMAX_BYTESNUMBER 10485760
このブロックの固定入力編集と互換性
record HTTP log [ENTRY]Adds a structured HTTP log entry JSON string to the extension log buffer.
Block type: COMMAND. Opcode: recordHttpLog. Permanent link
Argument Type Default value Menu choices ENTRYSTRING {"method":"GET","path":"/","status":200}
clear HTTP logsClears the extension log buffer.
Block type: COMMAND. Opcode: clearHttpLogs. Permanent link
This block has no arguments.
HTTP log viewer HTMLReturns a self-contained virtual-scroll HTML log viewer for buffered HTTP logs.
Block type: REPORTER. Opcode: httpLogViewerHtml. Permanent link
This block has no arguments.
HTTP log viewer HTML from [LOGS]Returns a self-contained virtual-scroll HTML log viewer from a JSON array of log entries.
Block type: REPORTER. Opcode: httpLogViewerHtmlFromJson. Permanent link
Argument Type Default value Menu choices LOGSSTRING [{"method":"GET","path":"/","status":200}]
new markdown documentCreates an empty Markdown builder handle.
Block type: REPORTER. Opcode: newMarkdownDocument. Permanent link
This block has no arguments.
markdown [DOC] with heading level [LEVEL] [TEXT]Appends a Markdown heading and returns the same builder handle.
Block type: REPORTER. Opcode: markdownHeading. Permanent link
Argument Type Default value Menu choices DOCSTRING md:1LEVELNUMBER 1TEXTSTRING Title
このブロックの固定入力編集と互換性
markdown [DOC] with paragraph [TEXT]Appends a Markdown paragraph and returns the same builder handle.
Block type: REPORTER. Opcode: markdownParagraph. Permanent link
Argument Type Default value Menu choices DOCSTRING md:1TEXTSTRING Hello
markdown [DOC] with bullet [TEXT]Appends a Markdown bullet and returns the same builder handle.
Block type: REPORTER. Opcode: markdownBullet. Permanent link
Argument Type Default value Menu choices DOCSTRING md:1TEXTSTRING Item
markdown [DOC] with code [CODE] language [LANG]Appends a fenced Markdown code block and returns the same builder handle.
Block type: REPORTER. Opcode: markdownCodeBlock. Permanent link
Argument Type Default value Menu choices DOCSTRING md:1CODESTRING console.log('hello')LANGSTRING js
render markdown [DOC]Renders a Markdown builder handle to Markdown text.
Block type: REPORTER. Opcode: renderMarkdown. Permanent link
Argument Type Default value Menu choices DOCSTRING md:1
new HTML element [TAG]Creates an HTML element builder handle.
Block type: REPORTER. Opcode: newHtmlElement. Permanent link
Argument Type Default value Menu choices TAGSTRING div
HTML text [TEXT]Creates an escaped HTML text node handle.
Block type: REPORTER. Opcode: htmlText. Permanent link
Argument Type Default value Menu choices TEXTSTRING Hello
HTML [NODE] with attribute [NAME] [VALUE]Sets an escaped attribute on an HTML element and returns the same handle.
Block type: REPORTER. Opcode: htmlSetAttribute. Permanent link
Argument Type Default value Menu choices NODESTRING html:1NAMESTRING classVALUESTRING content
HTML [PARENT] with child [CHILD]Appends a child node to an HTML element and returns the parent handle.
Block type: REPORTER. Opcode: htmlAppendChild. Permanent link
Argument Type Default value Menu choices PARENTSTRING html:1CHILDSTRING html:2
render HTML [NODE]Renders an HTML node handle to an HTML fragment.
Block type: REPORTER. Opcode: renderHtml. Permanent link
Argument Type Default value Menu choices NODESTRING html:1
render HTML document title [TITLE] body [BODY]Renders a full HTML document from an HTML body node handle.
Block type: REPORTER. Opcode: renderHtmlDocument. Permanent link
Argument Type Default value Menu choices TITLESTRING PageBODYSTRING html:1
Repository guide and examples