import requests # All POST/PUT/DELETE requests must have the following headers headers = {'X-Requested-With': 'XMLHttpRequest', 'Origin': 'https://example.claritylims.com'} session = requests.Session() # authenticate with the lims server, associates a cookie with the session response = session.post('https://example.claritylims.com/clarity/j_spring_security_check', {"j_username": "admin", "j_password": "password"}) response = session.post('https://example.claritylims.com/clarity/api/search-index/reindex', headers=headers) print response.text response = session.get('https://example.claritylims.com/clarity/api/search-index/status', headers=headers) print response.text