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 摘要。