xrDebug HTTP API standard defines a language-agnostic web service as variable introspection is generated on client-side.

Following examples use curl (opens new window) to issue HTTP requests to xrDebug API.

# Create debug message

POST /messages

When creating a debug message it will be streamed to xrDebug window.

All parameters are optional: body, emote, file_line, file_path, id, topic (but at least one is required).

curl --fail -X POST \
    --data "body=My message" \
    --data "file_path=file" \
    --data "file_line=1" \

# Create pause

POST /pauses

When creating a pause, a lock for the given id will be created. When the helper sends xri()->pause() the debugger creates a lock with {"stop":false} contents.

Requires id, supports optional body fields: body, emote, file_line, file_path, topic.

curl --fail -X POST \
    --data "id=b1cabc9a-145f-11ee-be56-0242ac120002" \

# Get pause

GET /pauses/{id}

If a pause exists it means that execution is paused for the given id. The helper which called xri()->pause() should sleep/wait while the pause exists. If pause contents are {"stop":false} the id is paused, if contents are {"stop":true} the id is stopped.

curl --fail -X GET \

# Delete pause

DELETE /pauses/{id}

When deleting a pause the lock previously created will be removed, which will enable client library to continue code execution.

curl --fail -X DELETE \

# Update pause (stop execution)

PATCH /pauses/{id}

When updating a pause it will update the pause to a full stop. GET requests will return {"stop":true}. The helper which called xri()->pause() should stop execution once the pause was updated to stop code execution.

curl --fail -X PATCH \

# Request signing

When using sign verification (-v option) requests must add the X-Signature header.

First, sign the data fields:

$serialize = serialize($data);
$sign = $privateKey->sign($serialize);
$signature = base64_encode($sign);

Then pass the signature header:

curl --fail -X POST \
    --data "body=My signed message" \
    --data "file_path=file" \
    --data "file_line=1" \
    -H "X-Signature: <signature>" \