I'm testing Zendesk Proxy Server to make an request to a third-party API. My original JavaScript code use fetch() for making request. Here how it is,
fetch(`${tokenUrl}/token`, {
method: 'POST',
body: new URLSearchParams({
'grant_type': 'client_credentials'
}),
headers: {
'Content-type': 'application/x-www-form-urlencoded',
'Authorization': `Basic ${basic_token}`
},
}).then((response) => response.json())
.then((data) => {
// my working code;
})
curl -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic basic_token" -X POST "url_to_request" -d "grant_type=client_credentials"
const client = ZAFClient.init();
const options = {
url: `${tokenUrl}/token`,
type: 'POST',
secure : true,
contentType: 'application/x-www-form-urlencoded',
headers: {
"Authorization": `Basic ${basic_token}`
},
data: new URLSearchParams({
'grant_type': 'client_credentials'
}),
};
client.request(options).then((response) => {
console.log(response);
});




As a separate update, I still have not seen any response with the zipped application in the other ticket. Could you send a comment update in there just to make sure we're receiving anything from you there?