Created
April 29, 2019 02:05
-
-
Save wanmigs/3a3a56bfd3e94279986c02ec46d81698 to your computer and use it in GitHub Desktop.
Fix Formdata on Patch Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let data = new FormData(); | |
data.append("_method", 'PATCH'); | |
// append another data .... | |
const headers = { | |
'Content-Type': 'multipart/form-data', | |
'enctype' : 'multipart/form-data', | |
'Authorization' : 'Bearer ' + token | |
} | |
axios({ | |
method : "POST", | |
baseURL: this.baseURL, | |
url : url, | |
params : params, | |
data : data, | |
headers: headers, | |
}).then(response => { | |
return response | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment