TurboWarp-HTTP-Server

TurboWarp extension documentation

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

ArgumentTypeDefault valueMenu choices
URLSTRINGws://127.0.0.1:8787/ws

connect to HTTP bridge

Opens a WebSocket connection to the configured HTTP bridge server.

Block type: COMMAND. Opcode: connect. Permanent link

This block has no arguments.

disconnect from HTTP bridge

Closes 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 bridge

Sends a text message to the connected HTTP bridge server.

Block type: COMMAND. Opcode: sendText. Permanent link

ArgumentTypeDefault valueMenu choices
MESSAGESTRING{"type":"ping"}

last HTTP bridge message

Returns the most recent text message received from the bridge.

Block type: REPORTER. Opcode: lastMessage. Permanent link

This block has no arguments.

when HTTP request received

Starts 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

ArgumentTypeDefault valueMenu choices
IDSTRINGreq-1

current request ID

Returns the current HTTP request ID.

Block type: REPORTER. Opcode: currentRequestId. Permanent link

This block has no arguments.

current HTTP method

Returns the current HTTP request method.

Block type: REPORTER. Opcode: currentHttpMethod. Permanent link

This block has no arguments.

current request path

Returns the current HTTP request path.

Block type: REPORTER. Opcode: currentRequestPath. Permanent link

This block has no arguments.

current request URL

Returns the current HTTP request URL.

Block type: REPORTER. Opcode: currentRequestUrl. Permanent link

This block has no arguments.

request header [NAME]

Returns the first value of a request header using case-insensitive lookup.

Block type: REPORTER. Opcode: requestHeader. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGaccept

query parameter [NAME]

Returns the first query parameter value.

Block type: REPORTER. Opcode: queryParameter. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGq

path parameter [NAME]

Returns a route path parameter value.

Block type: REPORTER. Opcode: pathParameter. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGid

current request body

Returns 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 type

Returns the current request Content-Type header.

Block type: REPORTER. Opcode: currentRequestContentType. Permanent link

This block has no arguments.

current request client address

Returns 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

ArgumentTypeDefault valueMenu choices
NAMESTRINGvalue
VALUESTRING0

change handler variable [NAME] by [AMOUNT]

Changes a request-local numeric variable using Scratch number conversion rules.

Block type: COMMAND. Opcode: changeHandlerVariable. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGvalue
AMOUNTNUMBER1

このブロックの固定入力編集と互換性

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

ArgumentTypeDefault valueMenu choices
NAMESTRINGvalue

handler variable [NAME] exists?

Reports whether a request-local handler variable exists.

Block type: BOOLEAN. Opcode: handlerVariableExists. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGvalue

delete handler variable [NAME]

Deletes a request-local handler variable.

Block type: COMMAND. Opcode: deleteHandlerVariable. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGvalue

delete all handler variables

Deletes all request-local handler variables for the current HTTP handler.

Block type: COMMAND. Opcode: clearHandlerVariables. Permanent link

This block has no arguments.

active handler variables

Returns comma-separated names of request-local handler variables.

Block type: REPORTER. Opcode: listHandlerVariables. Permanent link

This block has no arguments.

current auth type

Returns the current authentication type, such as digest or oauth.

Block type: REPORTER. Opcode: currentAuthType. Permanent link

This block has no arguments.

current authenticated user

Returns 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 provider

Returns the authentication provider name when available.

Block type: REPORTER. Opcode: currentAuthProvider. Permanent link

This block has no arguments.

current auth profile JSON

Returns 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

ArgumentTypeDefault valueMenu choices
NAMESTRINGemail

current response status

Returns 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

ArgumentTypeDefault valueMenu choices
STATUSNUMBER200

このブロックの固定入力編集と互換性

set response header [NAME] to [VALUE]

Sets a response header for the current request.

Block type: COMMAND. Opcode: setResponseHeader. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGcontent-type
VALUESTRINGtext/plain; charset=utf-8

remove response header [NAME]

Removes a response header for the current request.

Block type: COMMAND. Opcode: removeResponseHeader. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGcontent-type

response header [NAME]

Returns the first configured response header value.

Block type: REPORTER. Opcode: responseHeader. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGcontent-type

set response body [BODY]

Sets the current response body without completing the response.

Block type: COMMAND. Opcode: setResponseBody. Permanent link

ArgumentTypeDefault valueMenu choices
BODYSTRINGHello

send response [BODY]

Sets the response body and completes the current request.

Block type: COMMAND. Opcode: sendResponse. Permanent link

ArgumentTypeDefault valueMenu choices
BODYSTRINGHello

respond with text [BODY]

Responds with plain text.

Block type: COMMAND. Opcode: respondWithText. Permanent link

ArgumentTypeDefault valueMenu choices
BODYSTRINGHello

respond with HTML [BODY]

Responds with HTML.

Block type: COMMAND. Opcode: respondWithHtml. Permanent link

ArgumentTypeDefault valueMenu choices
BODYSTRING<p>Hello</p>

respond with JSON [BODY]

Responds with JSON.

Block type: COMMAND. Opcode: respondWithJson. Permanent link

ArgumentTypeDefault valueMenu 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

ArgumentTypeDefault valueMenu choices
NAMESPACESTRINGasset
NAMESTRINGavatar
KINDSTRINGasset
SCOPESTRINGproject
TARGET_IDSTRINGStage:1
REPRESENTATIONSTRINGraw
MAX_BYTESNUMBER10485760

このブロックの固定入力編集と互換性

record HTTP log [ENTRY]

Adds a structured HTTP log entry JSON string to the extension log buffer.

Block type: COMMAND. Opcode: recordHttpLog. Permanent link

ArgumentTypeDefault valueMenu choices
ENTRYSTRING{"method":"GET","path":"/","status":200}

clear HTTP logs

Clears the extension log buffer.

Block type: COMMAND. Opcode: clearHttpLogs. Permanent link

This block has no arguments.

HTTP log viewer HTML

Returns 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

ArgumentTypeDefault valueMenu choices
LOGSSTRING[{"method":"GET","path":"/","status":200}]

new markdown document

Creates 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

ArgumentTypeDefault valueMenu choices
DOCSTRINGmd:1
LEVELNUMBER1
TEXTSTRINGTitle

このブロックの固定入力編集と互換性

markdown [DOC] with paragraph [TEXT]

Appends a Markdown paragraph and returns the same builder handle.

Block type: REPORTER. Opcode: markdownParagraph. Permanent link

ArgumentTypeDefault valueMenu choices
DOCSTRINGmd:1
TEXTSTRINGHello

markdown [DOC] with bullet [TEXT]

Appends a Markdown bullet and returns the same builder handle.

Block type: REPORTER. Opcode: markdownBullet. Permanent link

ArgumentTypeDefault valueMenu choices
DOCSTRINGmd:1
TEXTSTRINGItem

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

ArgumentTypeDefault valueMenu choices
DOCSTRINGmd:1
CODESTRINGconsole.log('hello')
LANGSTRINGjs

render markdown [DOC]

Renders a Markdown builder handle to Markdown text.

Block type: REPORTER. Opcode: renderMarkdown. Permanent link

ArgumentTypeDefault valueMenu choices
DOCSTRINGmd:1

new HTML element [TAG]

Creates an HTML element builder handle.

Block type: REPORTER. Opcode: newHtmlElement. Permanent link

ArgumentTypeDefault valueMenu choices
TAGSTRINGdiv

HTML text [TEXT]

Creates an escaped HTML text node handle.

Block type: REPORTER. Opcode: htmlText. Permanent link

ArgumentTypeDefault valueMenu choices
TEXTSTRINGHello

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

ArgumentTypeDefault valueMenu choices
NODESTRINGhtml:1
NAMESTRINGclass
VALUESTRINGcontent

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

ArgumentTypeDefault valueMenu choices
PARENTSTRINGhtml:1
CHILDSTRINGhtml:2

render HTML [NODE]

Renders an HTML node handle to an HTML fragment.

Block type: REPORTER. Opcode: renderHtml. Permanent link

ArgumentTypeDefault valueMenu choices
NODESTRINGhtml: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

ArgumentTypeDefault valueMenu choices
TITLESTRINGPage
BODYSTRINGhtml:1

Repository guide and examples

固定入力の編集

対応GUIの固定入力機能は既定OFFです。既存値は開いただけでは変更せず、reporter接続は評価・置換しません。新しい選択と有限JSON数値入力のみを検証して保存し、既存の補正・丸め処理を維持します。機能OFFで従来の編集へ戻せます。

対象入力・Schemaの正本・互換性・切戻し