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
was an internal problem with a server move and path names changing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm glad you were able to find the issue. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.