I have read through all the relevant questions but did not see an answer to this specific question:
I need to download the repository (as an archive file) via the API v2.0 via node app. There will not be any user context for the request so I need to authenticate the request. I have been using Basic auth (using an app password) for the other api requests I have been using.
This url was suggested in one posting and it works from Postman:
https://bitbucket.org/<workspace>/<repoSlug>/get/main.zip
but I need to make the request via axios, and am having a hard time passing the proper authentication.
This is the current attempt that returns a 401:
axios.request({
method: 'get',
url:`https://bitbucket.org/${workspace}/${repoSlug}/get/${branch}.zip`,
responseType: 'stream',
headers: { auth: { username: secret.username, password: secret.password }}
});
I would rather make the request to the API, but have not found this functionality in the version 2 API.