Python http.client json Anfrage und Antwort. Wie?
Ich habe den folgenden Code, den ich auf Python 3.x aktualisieren möchte. Die erforderlichen Bibliotheken würden in http.client und json geändert.
Ich kann anscheinend nicht verstehen, wie es geht. Können Sie bitte helfen?
import urllib2
import json
data = {"text": "Hello world github/linguist#1 **cool**, and #1!"}
json_data = json.dumps(data)
req = urllib2.Request("https://api.github.com/markdown")
result = urllib2.urlopen(req, json_data)
print '\n'.join(result.readlines())