luch-request icon indicating copy to clipboard operation
luch-request copied to clipboard

http.upload('api/upload/img', ;这个怎么用?method是upload?

Open yangxun521 opened this issue 1 year ago • 0 comments

重新问一下

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}}) 093e25b9e0e3cee95a348d623084e7d

然后像正常调用接口调用,下方红框内是可以正常使用的(uni.uploadFile),但是接口调用报错;上方content-type不需要理会,设置与否都会报这个错 bf7c5b1760087b7a85c55e0fb83b5cd

7a733e3bafb46a58ade21ac752745ff 两个问题需要请教: 1、如果是参数传的方式不对,应该如何传,我传的是小程序返回的图片临时路径; 2、这个method总是显示upload方式,但是http请求不支持这种方式的; 有没有示例可以参考一下啊?问了很多人,基本没人用这种方式,只能请教作者大佬了,还请不吝赐教!!

Originally posted by @yangxun521 in https://github.com/lei-mu/luch-request/issues/134#issuecomment-1816028745

yangxun521 avatar Nov 18 '23 09:11 yangxun521