Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # create ticket
  3. import json
  4. import requests
  5. import os
  6.  
  7. ticket_info = {"autorespond": "false", "source": "API", "name": "Doctor Who", "email":"who@tardis.com", "subject":"Have you seen my Tardis key?", "message":"I have managed to lock myself out of the Tardis, can you send me a spare key?"}
  8. headers = {'X-API-Key' : '9E0D510140223F4B173E627FE0377082'}
  9. # response = requests.post("http://192.168.30.121/helpdesk/api/http.php/tickets.json", data=ticket_info, headers=headers)
  10. response = requests.request("POST", "http://192.168.30.121/helpdesk/api/http.php/tickets.json", data=ticket_info, headers=headers)
  11. # for r in response:
  12. # print(r)
  13. print(response.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement