CopyPastor

Detecting plagiarism made easy.

Score: 0.8050994984174179; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2020-02-21
by Tahir Iqbal

Original Post

Original - Posted on 2018-11-27
by Asif vora



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You can post axios data by using [FormData()][1] like :
var bodyFormData = new FormData();
And then add the fields to the form you want to send :
bodyFormData.set('product', productName);
If you are uploading single file, you may want to use `.append`
bodyFormData.append('file',file);
And then you can use axios post method (You can amend it accordingly)
axios({ method: 'post', url: 'myurl', data: bodyFormData, headers: {'Content-Type': 'multipart/form-data' } }) .then(function (response) { //handle success console.log(response); }) .catch(function (response) { //handle error console.log(response); });
You can read more [Here][2] [1]: https://developer.mozilla.org/en-US/docs/Web/API/FormData [2]: https://github.com/axios/axios/issues/318
You can post axios data by using [FormData()][1] like :
And then add the fields to the form you want to send :
let bodyFormData = new FormData(); bodyFormData.set('email',this.state.email); bodyFormData.set('password', this.state.password);
And then you can use axios post method (You can amend it accordingly)
axios({ method: 'post', url: 'http://127.0.0.1:8000/api/login', data: bodyFormData, config: { headers: {'Content-Type': 'multipart/form-data' }} }) .then(function (response) { //handle success console.log(response); }) .catch(function (response) { //handle error console.log(response); });
[1]: https://developer.mozilla.org/en-US/docs/Web/API/FormData

        
Present in both answers; Present only in the new answer; Present only in the old answer;