Confluence REST API, creating a new page with large excel data does not work

Praveen September 7, 2017

Hi,

I am trying to create a new page with large excel data using REST API i get the following error, but it works for smaller sized excel files

 {message: Response too large. request for this response can be at most 5242880 bytes, statuscode:413)

 

Tried setting MaxPostSize="-1" in server.xml still gives the same error 

 

code:

import requests;
import json;
import pandas as pd;
import xlrd;

 

def read_excel():
x=pd.read_excel("/exceldata.xls");
return x.to_html();


def new_confluence_page(space_key,title,body):
url='http://localhost:8090/confluence/rest/api/content/'
data = {"type":"page","title":title,"space":{"key":space_key},"body":{"storage":{"value":body,"representation":"storage"}}}
return requests.request('POST',url,auth=('admin','admin'), json=data)

def test_module():
table=read_excel();
resp=new_confluence_page('TEST1','TEST PAGE HOME-2',table)
print(json.loads(resp.text))

test_module()

 

 

 

 

1 answer

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 8, 2017

Praveen,

Can you increase the maximum size your server accepts? Have a look at the following for information on where you can update that:

Kind Regards,
Shannon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events