add update page method
This commit is contained in:
		
							parent
							
								
									b9e2b5bad9
								
							
						
					
					
						commit
						be157a9246
					
				
							
								
								
									
										10
									
								
								WikiUtils.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								WikiUtils.py
									
									
									
									
									
								
							@ -46,3 +46,13 @@ def get_attachment_contents(attachment_id, wiki_url, token_id, token_secret):
 | 
			
		||||
    attachment_data_decoded = base64.b64decode(attachment_data_encoded)
 | 
			
		||||
 | 
			
		||||
    return attachment_data_decoded
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def update_page(page_id, markdown, wiki_url, token_id, token_secret):
 | 
			
		||||
    headers = {}
 | 
			
		||||
    headers.update(get_auth_header(token_id, token_secret))
 | 
			
		||||
 | 
			
		||||
    data = {}
 | 
			
		||||
    data['markdown'] = markdown
 | 
			
		||||
 | 
			
		||||
    requests.put(wiki_url + "/api/pages/{}".format(page_id), data=data, headers=headers)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user