Horje
react fetch request with content type x-www-form-urlencoded Code Example
react fetch request with content type x-www-form-urlencoded
var details = {
    'userName': 'test@gmail.com',
    'password': 'Password!',
    'grant_type': 'password'
};

var formBody = [];
for (var property in details) {
  var encodedKey = encodeURIComponent(property);
  var encodedValue = encodeURIComponent(details[property]);
  formBody.push(encodedKey + "=" + encodedValue);
}
formBody = formBody.join("&");

fetch('https://example.com/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  },
  body: formBody
})




Javascript

Related
how to disable gravity for an object in matter.js Code Example how to disable gravity for an object in matter.js Code Example
html how to remove class with js Code Example html how to remove class with js Code Example
javascript loob array Code Example javascript loob array Code Example
angular absolute routerlink Code Example angular absolute routerlink Code Example
dayjs after Code Example dayjs after Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7