請求入參爲文件(file)類型

今天被問到一個問題,請求接口入參爲文件類型,但是報錯:Uncaught (in promise) TypeError:Cannot read property ‘protocal’ of undefined,可能是因爲請求頭的Content-Type屬性值,請求的時候加入語句 {‘Content-Type’:'multipart/form-data '} 常用取值:link.
相關文章
相關標籤/搜索