{
  "$schema": "../../schemas/service.schema.json",
  "kind": "service",
  "name": "http",
  "version": "1.0.0-draft.1",
  "purpose": "HTTP capability acquired through a declared System Service.",
  "declarationSchema": "../../../../Service.schema.json",
  "types": "types.json",
  "functions": {
    "send": {
      "parameters": [
        {
          "name": "body",
          "type": {
            "nullable": "core.payload"
          },
          "required": false,
          "default": null
        },
        {
          "name": "overrides",
          "type": {
            "nullable": "http.RequestOverrides"
          },
          "required": false,
          "default": null
        }
      ],
      "returns": {
        "nullable": "http.HttpResult"
      },
      "purpose": "HttpResult, or null for configured asynchronous submission.",
      "statementOnly": false
    }
  },
  "rules": [
    "send takes the body first and optional request overrides second. A one-argument object is always the body. Omitted or null body means no body. Only post, put and patch transmit it.",
    "Bytes pass unchanged; strings encode as UTF-8 without quoting; other data serialize through Object.asString and UTF-8. Set the appropriate content type explicitly.",
    "HttpResult exposes status, case-insensitive headers containing arrays of values, and bytes. Decode and parse response bytes explicitly.",
    "Configured asynchronous submission returns null and discards the eventual response. It is not durable delivery and differs from an AIScript async scope."
  ]
}
