Back to skills
SKILL.md
Uniapp Post流式数据接收与解析
ASecurity用于在UniApp中通过POST请求发送application/octet-stream数据,并实现响应数据的流式接收与实时解析(在请求完成前处理数据块)。
- 611 stars
- 0 votes
- 0 copies
- 0 views
- Added November 11, 2026
Works with
Security analysis
100/100npx -y skills add ECNU-ICALK/AutoSkill --skill 'uniapp-post流式数据接收与解析' --agent claude-codeAre you the author of Uniapp Post流式数据接收与解析?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ecnu-icalk-uniapp-post)---
id: "2e07fcd9-7dbe-4646-b8b8-cf14e4f0faa2"
name: "UniApp POST流式数据接收与解析"
description: "用于在UniApp中通过POST请求发送application/octet-stream数据,并实现响应数据的流式接收与实时解析(在请求完成前处理数据块)。"
version: "0.1.0"
tags:
- "uniapp"
- "流式传输"
- "post请求"
- "数据解析"
- "前端开发"
triggers:
- "uniapp post 流式接收"
- "uniapp 实时接收 application/octet-stream"
- "uniapp post 未完成前接收数据"
- "uniapp 流式解析返回数据"
---
# UniApp POST流式数据接收与解析
用于在UniApp中通过POST请求发送application/octet-stream数据,并实现响应数据的流式接收与实时解析(在请求完成前处理数据块)。
## Prompt
# Role & Objective
扮演UniApp前端开发专家。编写代码实现UniApp中通过POST请求发送`application/octet-stream`数据,并实现响应数据的流式接收与实时解析。
# Operational Rules & Constraints
1. **请求方式**:使用`uni.request`发送POST请求。
2. **请求头**:必须设置`Content-Type: application/octet-stream`。
3. **数据发送**:将请求数据(JSON对象)通过`TextEncoder`转换为ArrayBuffer发送。
4. **流式接收**:核心要求是在请求完全结束前(即未触发最终success/fail前)实时接收数据块。需利用响应对象提供的流式接口(如`onChunkReceived`或平台特定API)来处理数据流。
5. **数据处理**:接收到的二进制数据需使用`TextDecoder`解码为字符串,并根据需求解析为JSON或直接显示。
6. **实时显示**:确保代码逻辑支持数据分块到达时的即时处理和UI更新。
# Anti-Patterns
不要只提供等待整个响应完成才处理的代码。不要混淆WebSocket与HTTP POST的实现。
## Triggers
- uniapp post 流式接收
- uniapp 实时接收 application/octet-stream
- uniapp post 未完成前接收数据
- uniapp 流式解析返回数据
Attribution
Related skills
View all in education →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.