Skip to content

Commit

Permalink
Merge pull request #107 from moorereason/requests-put-file-handle
Browse files Browse the repository at this point in the history
Pass file object to requests post
  • Loading branch information
grahampugh authored Jan 16, 2021
2 parents 3b54ebd + 9900699 commit a4577dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jss/distribution_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def _copy(self, filename, id_=-1, file_type=0):
"FILE_TYPE": file_type, "FILE_NAME": basefname}
response = self.connection["jss"].session.post(
url=self.connection["upload_url"],
data=resource.read(),
data=resource,
headers=headers)
if self.connection["jss"].verbose:
print(response)
Expand All @@ -680,7 +680,7 @@ def _copy_new(self, filename, id_=-1, file_type=0):
"fileIdentifier": "FIELD_FILE_NAME_FOR_DIST_POINTS"}
response = self.connection["jss"].session.post(
url=self.connection["upload_url"],
data=resource.read(),
data=resource,
headers=headers)
print(response)
if self.connection["jss"].verbose:
Expand Down

0 comments on commit a4577dd

Please sign in to comment.