GuardMarket

encoding.url_parse

解析 URL

Split a URL into components without requesting it; invalid ports raise an input error.

Version 1.0.0确定性数据处理Backend required

使用场景 / Purpose

Encoding: url parse. 本技能对提供的参数执行计算,输入输出契约如下。文档例子来自已实现函数的固定验收样例;网页本身不执行代码。

输入字段 / Parameters

字段类型要求约束与说明
url"string"必填 Required{"minLength": 0, "maxLength": 8000}

输入例子 / Example input

{
  "url": "https://shop.example:8443/items?q=shirt#size"
}

预期输出 / Expected output

{
  "scheme": "https",
  "hostname": "shop.example",
  "port": 8443,
  "path": "/items",
  "query": "q=shirt",
  "fragment": "size"
}
完整输入 JSON Schema
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "minLength": 0,
      "maxLength": 8000
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "maxProperties": 1000
}
完整输出 JSON Schema
{
  "type": "object",
  "properties": {
    "scheme": {
      "type": "string",
      "minLength": 0,
      "maxLength": 8000
    },
    "hostname": {
      "type": "string",
      "minLength": 0,
      "maxLength": 8000
    },
    "port": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 65535
    },
    "path": {
      "type": "string",
      "minLength": 0,
      "maxLength": 8000
    },
    "query": {
      "type": "string",
      "minLength": 0,
      "maxLength": 8000
    },
    "fragment": {
      "type": "string",
      "minLength": 0,
      "maxLength": 8000
    }
  },
  "required": [
    "scheme",
    "hostname",
    "port",
    "path",
    "query",
    "fragment"
  ],
  "additionalProperties": false,
  "maxProperties": 1000
}