# 请求协议以及响应格式

## 1、HTTP请求协议以及响应协议

### 1.1、请求头

所有HTTP接口均为`GET`请求，需要在请求头`Headers`里面固定设置您的API Key

![](https://files.readme.io/ff7c58f896427ad7a1bd2684d02dcea12ed386fabbfdd945f10eb77582234548-image.png)

### 1.2、响应格式

```
{
    "ret": 200,
    "msg": "success",
    "traceId": "698f920a-c53b-401c-bfac-4ea46b9b8f12",
    "data": [
        
    ]
}
```

| 字段        | 描述                                                                         |
| --------- | -------------------------------------------------------------------------- |
| `ret`     | 响应码。`200`为正常响应（[错误码](https://infoway.readme.io/reference/http-error-code)） |
| `msg`     | success                                                                    |
| `tradeId` | 由系统生成的唯一ID                                                                 |
| `data`    | 响应数据返回                                                                     |

## 2、Websocket

所有类型的WebSocket连接，地址相同，仅参数不同，详情请看[Websocket订阅地址说明](https://docs.infoway.io/websocket-api/endpoints)和[Websocket代码示例](https://docs.infoway.io/websocket-api/code-examples)。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infoway.io/getting-started/api-protocols-and-response-formats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
