bramton / degiro

Very basic unofficial Python API for DeGiro
BSD 3-Clause "New" or "Revised" License
52 stars 16 forks source link

Unused local variable header in login() #6

Closed chmike closed 5 years ago

chmike commented 5 years ago

At line 21, you have the instruction :

header={'content-type': 'application/json'}

But this variable is never used.

You then have the instruction:

r = self.sess.post(url, data=json.dumps(payload))

Shouldn't it be :

r = self.sess.post(url, headers=header, data=json.dumps(payload))

Or something like that ?

chmike commented 5 years ago

Another possibility could be to write

self.sess.headers.update({'content-type': 'application/json'})

Which would ensure that every request has this header.

bramton commented 5 years ago

Well spoted :+1: It has been resolved now.