Implement posting fit to EVE server

This commit is contained in:
blitzmann
2018-02-08 01:50:52 -05:00
parent 5fbe623ae6
commit dfba033190
4 changed files with 33 additions and 49 deletions

View File

@@ -187,11 +187,18 @@ class Crest(object):
resp = char.esi_client.request(op)
return resp.data
def postFitting(self, charID, json):
# @todo: new fitting ID can be recovered from Location header,
# ie: Location -> https://api-sisi.testeveonline.com/characters/1611853631/fittings/37486494/
def postFitting(self, charID, json_str):
# @todo: new fitting ID can be recovered from resp.data,
char = self.getSsoCharacter(charID)
return char.eve.post('%scharacters/%d/fittings/' % (char.eve._authed_endpoint, char.ID), data=json)
op = Crest.esi_v1.op['post_characters_character_id_fittings'](
character_id=char.characterID,
fitting=json.loads(json_str)
)
resp = char.esi_client.request(op)
return resp.data
def delFitting(self, charID, fittingID):
char = self.getSsoCharacter(charID)