Kong / Kong/httpsnippet

Better support for multipart/form-data file upload examples

未关闭
#241 4 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
1.2k
派生
242
PR 合并指标
30 天内没有已合并 PR

描述

Currently in the JS / Fetch example, it shows multipart file uploads like so:

![image](https://user-images.githubusercontent.com/587740/150023128-b3f1d5ae-1507-4a30-b972-2c3dd061f91f.png)

This doesn't work as it just sends the string "logo.png" instead of the file.

A better example might be:

```js
// HTML file input, chosen by user
const fileInputs = document.querySelectorAll('input[type="file"]')

form.append("file", fileInputs[0].files[0]);
```

贡献指南

打开贡献指南

调研方向

Start by locating the JS/Fetch multipart/form-data example and the code that generates its file-upload snippet. Compare the current output with the issue's File-based example, then verify that generated multipart examples reference the selected file rather than the string "logo.png".

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, typescript
领域
tooling, web-dev
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。