Hi,
I’m trying to connect to the Discogs API, and my AI scripting buddy tells me “The failure likely occurred because the Discogs API strictly requires a User-Agent header, which Tap Forms Pro cannot currently send through its built-in Utils methods”.
Any suggestions to help on this?
reference: https://www.discogs.com/developers
Your application must provide a User-Agent string that identifies itself – preferably something that follows RFC 1945.
If you use Utils.makeHTTPRequest() to make your request, you can provide the user-agent header.
Here’s an example:
const url = "...";
const headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + accessToken,
};
const response = Utils.makeHTTPRequest(url, JSON.stringify(data), headers, "POST");
console.log(JSON.stringify(response,"",4));
Cheers, Daniel
---
See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks
The only glitch in the Matrix is the Utils.makeHTTPRequest() function is only available in Tap Forms Pro.
Thank you so much. Fortunately I am using Pro. My dumb AI scripting buddy was using the 5.3 API reference. It is working now.