-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question(http): Can I describe form data or x-www-form-urlencoded data? Or any way to support it? #106
Comments
See the code in farrow-http/src/util.ts |
Oh, I see. But the form data maybe not the json-like data. If I want to upload file like this: var input = document.querySelector('input[type="file"]')
var data = new FormData()
data.append('file', input.files[0])
data.append('user', 'hubot')
fetch('/avatars', {
method: 'POST',
body: data
}) How should I describe it with |
We can use import { Unknown } from 'farrow-schema'
http.post('/avatars', {
body: Unknown
}).use(request => {
const body = getFormData(request.body)
}) |
file文件上传怎么搞呀 |
@simonyouth 建议实用 farrow-express 或 farrow-koa 适配器来用 farrow,这样上传文件部分,可以沿用 |
like this:
form data
or
x-www-form-urlencoded data
The text was updated successfully, but these errors were encountered: