
Segue um exemplo em node, utilizando axios:
js
var axios = require('axios');
var data = JSON.stringify({
"grant_type": "client_credentials"
});
var config = {
method: 'post',
url: 'https://apis.gerencianet.com.br/pagamento/oauth/token',
headers: {
'x-client-cert-pem': '{{X-Certificate-Pem}}',
'Authorization': 'Basic <>',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var axios = require('axios');
var data = JSON.stringify({
"grant_type": "client_credentials"
});
var config = {
method: 'post',
url: 'https://apis.gerencianet.com.br/pagamento/oauth/token',
headers: {
'x-client-cert-pem': '{{X-Certificate-Pem}}',
'Authorization': 'Basic <>',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});