Currently I'm getting this error when I tried to update the confluence page.
error: HTTP RESONPONSE 500
this is my code:
################
import re
import bs4
import requests
headers={'Content-Type': 'application/json','Authorization': 'Basic token'}
dataurl='https://page/wiki/rest/api/content/1212121212?expand=body.storage'
contentx = requests.get(address, headers=headers).json()
content=contentx['body']['storage']['value']
regex = re.compile(r"<td>i need to update this</td>")
new_content = regex.sub("<td>updated</td>", content)
soupx = bs4.BeautifulSoup(new_content, features="html.parser")
soup=str(soupx)
payload={'id':'121212121212,'type':'page','title':'testing12121212','space':{'key':'space'},"body":{"storage":{"value":soup,"representation":"storage"}},'version':{'number':2}}
##########
i couldn't find what is the issue.
can someone help on this
Hello,
First of all I can't see where you do the update. Is this the whole script?
Second, check if the get works without a problem. Return contentx and see what it says. You should see which line you get the error.
Regards,
Elifcan
Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!
Help us plant more trees
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.