Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Unable upload file to bitbucket using POST with token

I successfully retrieved a token and able to use GET to retrieve a list of files from

But, while using POST in attempt to upload a file I am getting 406 Not Acceptable error

I am using httr:POST function of R

encode = "multipart",
httr::add_headers(Authorization = token),
body = upload_file("Path_to_file/hello.txt"),

The full response is:

-> POST /2.0/repositories/companyname/project/downloads HTTP/1.1
-> Host:
-> User-Agent: libcurl/7.64.1 r-curl/4.3 httr/1.4.1
-> Accept-Encoding: deflate, gzip
-> Accept: application/json, text/xml, application/xml, */*
-> Content-Type: text/plain
-> Authorization: Bearer YM60jBsTlbN2ZdvJertb2ZjJKBIv62U59umhDN3dTKJnvvM18a7AaF-MIhZWoFYtSSh5ihX4dJws2C0ldPCwKldxDN15e7VvqiZ9cNcRXdveaN7F94wfnyV2Ytf
-> Content-Length: 20
>> HelloWorld i am here

<- HTTP/1.1 406 Not Acceptable
<- Server: nginx
<- Vary: Authorization, cookie, user-context
<- Cache-Control: no-cache, no-store, must-revalidate, max-age=0
<- Content-Type: application/json; charset=utf-8
<- X-OAuth-Scopes: pipeline, snippet, wiki, repository:delete, repository:admin, repository:write, project:write
<- X-B3-TraceId: a42dd69cbefe4998
<- X-Dc-Location: ash2
<- Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
<- Date: Tue, 23 Feb 2021 20:29:34 GMT
<- Expires: Tue, 23 Feb 2021 20:29:34 GMT
<- X-Served-By: app-3006
<- X-Static-Version: 28799d1fab09
<- X-Accepted-OAuth-Scopes: repository:write
<- X-Credential-Type: oauth2
<- X-Render-Time: 0.308979034424
<- Connection: Keep-Alive
<- X-Request-Count: 2085
<- X-Frame-Options: SAMEORIGIN
<- X-Version: 28799d1fab09
<- Content-Length: 92

Please, help!

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,706 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you