mirror of
https://git.wownero.com/wownero/wownero-funding-system.git
synced 2024-08-15 00:53:45 +00:00
Refactor Daemon._make_request()
This commit is contained in:
parent
1a997aace6
commit
470173db63
1 changed files with 6 additions and 6 deletions
|
@ -152,10 +152,10 @@ class Daemon:
|
|||
}
|
||||
|
||||
def _make_request(self, data):
|
||||
if self.username:
|
||||
if self.password:
|
||||
r = requests.post(self.url, auth=HTTPDigestAuth(settings.RPC_USERNAME, settings.RPC_PASSWORD), json=data, headers=self.headers)
|
||||
else:
|
||||
r = requests.post(self.url, json=data, headers=self.headers)
|
||||
options = {'json': data, 'headers': self.headers}
|
||||
if self.username and self.password:
|
||||
options['auth'] = HTTPDigestAuth(settings.RPC_USERNAME, settings.RPC_PASSWORD)
|
||||
|
||||
r = requests.post(self.url, **options)
|
||||
r.raise_for_status()
|
||||
return r.json()
|
||||
return r.json()
|
||||
|
|
Loading…
Reference in a new issue