luch-request
luch-request copied to clipboard
http.upload('api/upload/img', ;这个怎么用?method是upload?
重新问一下
https://www.quanzhan.co/luch-request/guide/3.x/#upload 非常抱歉 我是滚动页面到#upload这里,但是没注意url是#request,让作者产生歧义了。
export const upl = file => uni.$uv.http.upload('resource/oss/upload', {filePath: file, header: { 'Content-Type': 'multipart/form-data' }, custom: {auth: true}})
然后像正常调用接口调用,下方红框内是可以正常使用的(uni.uploadFile),但是接口调用报错;上方content-type不需要理会,设置与否都会报这个错
两个问题需要请教:
1、如果是参数传的方式不对,应该如何传,我传的是小程序返回的图片临时路径;
2、这个method总是显示upload方式,但是http请求不支持这种方式的;
有没有示例可以参考一下啊?问了很多人,基本没人用这种方式,只能请教作者大佬了,还请不吝赐教!!
Originally posted by @yangxun521 in https://github.com/lei-mu/luch-request/issues/134#issuecomment-1816028745