upload中ctx的files是如何看出来
来源:9-10 HTTP API调用云存储上传文件并保存云数据库
图图3518
2020-01-16
我试着打印了一下ctx.request和ctx.request.files,都可以打印出来但是ctx.request中并不能找到files的相关信息是怎么回事
ctx.request打印出来的信息
{ method: ‘POST’,
url: ‘/swiper/upload’,
header:
{ host: ‘localhost:3000’,
connection: ‘keep-alive’,
‘content-length’: ‘8774’,
origin: ‘http://localhost:9528’,
‘user-agent’:
‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36’,
‘content-type’:
‘multipart/form-data; boundary=----WebKitFormBoundaryoYoTH1r4cXaVia11’,
accept: ‘/’,
‘sec-fetch-site’: ‘same-site’,
‘sec-fetch-mode’: ‘cors’,
referer: ‘http://localhost:9528/’,
‘accept-encoding’: ‘gzip, deflate, br’,
‘accept-language’: ‘zh-CN,zh;q=0.9’ } }
1回答
-
ctx.request打印出来的是请求头里的内容
012020-01-16
相似问题