Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import requests
  2.  
  3. with open('test.json') as data:
  4. headers = {'Authorization': 'Bearer 26lhbngfsybdayabz6afrc6dcd'
  5. 'Content-Type' : 'application/json'}
  6. r = requests.post('https://api.smartsheet.com/1.1/sheets',
  7. headers=headers, data=data)
  8.  
  9. print r.json
  10.  
  11. import pycurl
  12.  
  13. with open('test.json') as json:
  14. data = json.read()
  15.  
  16. c = pycurl.Curl()
  17. c.setopt(pycurl.URL, 'https://api.smartsheet.com/1.1/sheets')
  18. c.setopt(pycurl.POST, 1)
  19. c.setopt(pycurl.POSTFIELDS, data)
  20. c.setopt(pycurl.HTTPHEADER, ['Authorization: Bearer 26lhbngfsybdayabz6afrc6dcd',
  21. 'Content-Type: application/json'])
  22.  
  23. c.perform()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement