Skip to content

Commit

Permalink
Updated reqrest post function
Browse files Browse the repository at this point in the history
  • Loading branch information
rorymurdock committed May 19, 2020
1 parent 8346974 commit e8d4acc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
reqrest>=0.0.8
reqrest>=1.0.0
basic-auth
12 changes: 6 additions & 6 deletions wso/wso.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ def create_group(self, name, payload):
self.error('Group %s already exists' % name)
return False

response = self.rest_v1.post('/api/mdm/smartgroups/', payload=payload)
response = self.rest_v1.post('/api/mdm/smartgroups/', json=payload)

if self.check_http_response(response):
print('Group %s created successfully, id: %s' %
Expand Down Expand Up @@ -1021,7 +1021,7 @@ def x_tag(self, action, tag_id: int, devices: list):

response = self.rest_v1.post('/api/mdm/tags/%i/%sdevices' %
(tag_id, action),
payload=payload)
json=payload)

return self.check_http_response(response)

Expand Down Expand Up @@ -1056,7 +1056,7 @@ def create_tag(self, tagname: str, org_group=None, tagtype=1):
payload['TagName'] = tagname
payload['TagType'] = tagtype

response = self.rest_v1.post("/api/mdm/tags/addtag", payload)
response = self.rest_v1.post("/api/mdm/tags/addtag", json=payload)

if self.check_http_response(response):
return json.loads(response.text)['Value']
Expand Down Expand Up @@ -1191,7 +1191,7 @@ def create_og(self,
return False

response = self.rest_v2.post("/api/system/groups/%i" % parentog_id,
payload=payload)
json=payload)

if self.check_http_response(response):
return self.str_to_json(response.text)
Expand Down Expand Up @@ -1224,7 +1224,7 @@ def reprocess_product(self, product_id, device_list, force=True):
payload['ProductID'] = product_id

response = self.rest_v1.post('/api/mdm/products/reprocessProduct',
payload=payload)
json=payload)

return self.check_http_response(response)

Expand Down Expand Up @@ -1280,7 +1280,7 @@ def create_product(self,
if not product_name:
self.debug("Product %s does not exist" % name)

response = self.rest_v1.post('/api/mdm/products/create', payload)
response = self.rest_v1.post('/api/mdm/products/create', json=payload)

if self.check_http_response(response):
return self.str_to_json(response.text)['Value']
Expand Down

0 comments on commit e8d4acc

Please sign in to comment.