Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Create URL

Creates a URL for the Desktop Homunculus API with optional query parameters.

Parameters

  • path (string): The API endpoint path (relative to base URL)
  • params (object, optional): Query parameters to append to the URL

Returns

A URL instance ready for use in HTTP requests, pointing to http://localhost:3100/{path}.

Examples

Simple Path

const url = Deno.api.host.createUrl("vrm/all");
// Result: http://localhost:3100/vrm/all

With Query Parameters

const url = Deno.api.host.createUrl("entities", {
    name: "VRM",
    root: 123
});
// Result: http://localhost:3100/entities?name=VRM&root=123
  • get - Uses created URLs for GET requests
  • post - Uses created URLs for POST requests
  • put - Uses created URLs for PUT requests