Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions centreonapi/webservice/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-

import requests
import json
from requests.packages.urllib3.exceptions import InsecureRequestWarning


Expand Down Expand Up @@ -58,7 +57,7 @@ def auth(self):
"""
request = requests.post(
self.url + '/api/index.php?action=authenticate',
data={
json={
'username': self.authuser,
'password': self.authpass
},
Expand Down Expand Up @@ -95,11 +94,8 @@ def call_clapi(self, action=None, obj=None, values=None):

request = requests.post(
self.url + '/api/index.php?action=action&object=centreon_clapi',
headers={
'Content-Type': 'application/json',
'centreon-auth-token': self.auth_token
},
data=json.dumps(data),
headers={'centreon-auth-token': self.auth_token},
json=data,
verify=self.check_ssl
)
request.raise_for_status()
Expand Down