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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,368
Community Members
 
Community Events
184
Community Groups

update via REST returns 415

I've gotten this to work in the past but for some reason i'm no longer able to update our wiki via API, i'm continually getting a 415 response. 

I'm using python3 and I've tried via requests package and the atlassian Confluence methods. Both return 415 regardless if I supply content-type in my header or not. Actually using  '''from atlassian import Confluence''' I'm not even sure how to supply content-type, the docs are not that good and I'm assuming it defaults to application/json. 

The GET calls return with no problem, it's just the PUT method that is giving me issues.

 

raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 415 Client Error:  for url: https://confluence.servers.xxxxx/rest/api/content/123455667

 

3 answers

1 accepted

0 votes
Answer accepted

was an internal problem with a server move and path names changing

@balvey27 are your python put requests works fine now ?

0 votes
WW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 01, 2022

The problem would be easier to diagnose if we could see exactly what you're sending.

I'm not sure what '''from atlassian import Confluence''' is, but Content-Type can be supplied as a header like any other header.

In python, it'd be something like:

response=requests.put(
"https://www.myconfluence.com/",
headers={"Content-Type":"application/json"},
data ={'key':'value'}
)

Is the problem happening for every page you try with different content? It's possible you have some weird character(s) in the Json you're trying to PUT.

You can also see REST API: "Error 415 Unsupported Media Type"

sorry, it's the atlassian-python-api package for python. it's building the requests calls internally, and it doesn't look like there's an option to pass custom headers, but it does appear to set the content-type to application/json 

 

I've tried even sending a simple <p>sometext</p> string for the data and it returns 415. I've tried multiple pages as well. 

 

and I've built my own requests calls but they have the same results. I can pull data fine though, page_exists, and doing a GET on basic information works as it should.

 

beginning to wonder if it's a bug in this version. we're on 7.3.4. It's been a while since I successfully updated a page, and I'm not sure if it was an earlier version. 

WW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 04, 2022

Are you able to do any other PUT/POST/DELETE actions?

In that link I posted in my answer, it also says:

Sometimes making cURL requests to http addresses behing SSL would also cause this 415 error

I think it's supposed to say "behind" (or maybe "being"?).

I don't really understand what that means, though, either way it's spelled. When doing a google search on error 415 SSL, you'll see some results that say that the error could be related to something with an SSL certificate like this page. No idea how to fix any of that, but it might help lead you to a fix.

Thank you for the response, I have found the issue and it was nothing to do with content. Our wiki is ran internally and they moved to a new server, the redirect they had in place got dropped and post/put actions were not being handled by it properly. 

 

That said, my 415 is now resolved, but now I'm getting 400 errors and think it's due to size limitations of the amount of data i'm trying to update it with. That or there is a bad character in the data. 

WW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 04, 2022

I'm glad you were able to find the issue. :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events