> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 API

> 将 API 资源公开给授权用户和 IP 地址，并查询 API 端口。

为 API 创建资源后，可以将它们公开给授权用户和 IP 地址。知行之桥使用基于身份验证令牌的身份验证，并支持主要的身份验证方案。点击 **用户** 选项卡可管理用户的身份验证令牌和权限。要定义允许访问应用程序的 IP 地址，请点击 **服务器** 选项卡。

现在可以在浏览器中查询 API，如下面的示例查询和响应所示。

**请求**

`http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars`

**响应**

```json theme={null}
{ 
  "@odata.context":"http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/$metadata#Cars",
  "value":[
    { "Id": "10001", "Model": "MyModel1", "Color": "Red" },
    { "Id": "10002", "Model": "MyModel2", "Color2": "Blue" }
  ]
}
```

## 重写 HTTP 方法

某些客户端可能无法为特定操作发出正确的 HTTP 方法。可以使用 `@x-http-method` 查询字符串输入参数或 `X-HTTP-Method` HTTP 消息头来覆盖请求的 HTTP 方法。例如，不支持 HTTP PUT 方法的客户端可以在 GET 请求中包含 *X-HTTP-Method: PUT* 消息头，以发出资源更新请求。
