Skip to content
Back to skills

Uniapp Post流式数据接收与解析

ASecurity

用于在UniApp中通过POST请求发送application/octet-stream数据,并实现响应数据的流式接收与实时解析(在请求完成前处理数据块)。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationapi

Works with

  • api

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 'uniapp-post流式数据接收与解析' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Uniapp Post流式数据接收与解析?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Uniapp Post流式数据接收与解析
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-uniapp-post/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-uniapp-post)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.