Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×Im using the confluence REST API in python.
Im importing html using:
def create_page @ atlassian.confluence
def create_page(self, space, title, body, parent_id=None, type='page',
representation='storage'):
The imported html contains images. How can i upload these images (or references to them as included in the confluence page) using the REST API in python? Is it enough to change the type here to multimedia, and do something like:
import os
import requests
url = 'http://host:port/endpoint'
with open(path_img, 'rb') as img:
name_img= os.path.basename(path_img)
files= {'image': (name_img,img,'multipart/form-data',{'Expires': '0'}) }
with requests.Session() as s:
r = s.post(url,files=files)
print(r.status_code)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.