Joe Joe - 4 months ago 45
HTTP Question

How to use http 'POST' with form-data body instead of json body? (Angular2/Typescript)

I have some request I want to perform, and until now I used the with json's like this:"", JSON.stringify({"email": "","password":"123","user_token":"sss"}), RequestOptionsArgs);

but this won't work since this request to this website needs to be form-data can I take this same call and change it to be form-data?


Rem Rem

As i can see in Angular 2 tests you should use FormData object. ie:

let body = new FormData();
body.append('email', '');
body.append('password', '123');"", body);