MunifTanjim / node-bitbucket

Bitbucket API client for Browser and Node.js
https://bitbucketjs.netlify.app
MIT License
106 stars 28 forks source link

Downloads GET not working #57

Open mrgoonie opened 4 years ago

mrgoonie commented 4 years ago

I tried this API but it didn't work due to some redirect issue (I guessed)...

const { data, headers } = await bitbucket.downloads.get({ filename, repo_slug, workspace, fields })
jcramirez commented 4 years ago

Did you also get a "Bad request" Error 404?

I can successfully list the downloads for an specific workspace and repo_slug.

amente commented 4 years ago

The list API bitbucket.downloads.list works just fine. But, I have an issue with bitbucket.downloads.get API. I am using version: 2.3.0 I get HTTPError: Bad Request with 400 status code. It seems like the request is sent with accept: 'application/json' header, which doesn't work after a redirect since the download content requires a different accept header.