Thanks for the response and the reference.
I don’t see any request options that would allow me to provide these files.
I’m trying to do this (node):
const https = require('https')
const querystring = require('querystring')
const options = {
cert: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n",
key: "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----\n",
host: 'accounts.adp.com',
path: '/auth/oauth/v2/token',
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}
const requestData = {
grant_type: 'client_credentials',
client_id: 'REDACTED',
client_secret: 'REDACTED',
}
const requestBody = querystring.stringify(requestData);
const req = https.request(options, (res) => {
let response = ''
console.log('Status Code:', res.statusCode);
res.on('data', (chunk) => {
response += chunk
})
res.on('end', ()=>{
console.log('Body: ', JSON.parse(response));
})
}).on("error", (err) => {
console.error("Error: ", err.message);
});
req.write(requestBody)
req.end()
Can this be done with your z object natively?
Hey Benjamin,
We document the z object here. You can definitely send POST requests, but I don’t know for sure about the SSL cert and key. You might need to play around to find out.
Let us know if you have any more questions!