Guest User

Untitled

a guest
May 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. # ./lineprocessor capitalizer.js -p 9222 --main-cycle-in-cpp --callback
  4.  
  5. import httplib
  6. import json
  7.  
  8. v8Connection = httplib.HTTPConnection('localhost:9222')
  9.  
  10. # jsonHeader = { "Content-type": "application/json" }
  11.  
  12. continueRequest = { "seq": 1, "type": "request", "command" : "continue" }
  13.  
  14. continueRequestJSON = json.dumps(continueRequest)
  15.  
  16. v8Connection.request("POST", "", continueRequestJSON)
  17.  
  18. v8Response = v8Connection.getresponse()
  19.  
  20. print v8Response.status, v8Response.reason
  21.  
  22. data = v8Response.read()
  23.  
  24. print data
  25.  
  26. v8Connection.close()
Add Comment
Please, Sign In to add comment