Permalink
Browse files

Do not verify SSL certificate and dump json data

  • Loading branch information...
1 parent 4954074 commit 613bf5de47112232c9347b06ea6e7ed91b776613 @william-gr william-gr committed Nov 22, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 examples/api/newuser.py
View
@@ -1,10 +1,12 @@
+import json
import requests
r = requests.post(
'https://freenas.mydomain/api/v1.0/account/users/',
auth=('root', 'freenas'),
headers={'Content-Type': 'application/json'},
- data={
+ verify=False,
+ data=json.dumps({
'bsdusr_uid': '1100',
'bsdusr_username': 'myuser',
'bsdusr_mode': '755',
@@ -13,6 +15,6 @@
'bsdusr_shell': '/usr/local/bin/bash',
'bsdusr_full_name': 'Full Name',
'bsdusr_email': 'name@provider.com',
- },
+ }),
)
print r.text

0 comments on commit 613bf5d

Please sign in to comment.