複数のパラメータを持つURLでcurl呼び出しを行いたい。以下にコードをリストしました。たとえば、「curl -d @filter」と同等のオプションはありますか、それともパラメータをURLエンコードしますか?
SER = foobar
PASS = XXX
STREAM_URL = "http://status.dummy.com/status.json?userId=12&page=1"
class Client:
def __init__(self):
self.buffer = ""
self.conn = pycurl.Curl()
self.conn.setopt(pycurl.USERPWD, "%s:%s" % (USER,PASS))
self.conn.setopt(pycurl.URL, STREAM_URL)
self.conn.setopt(pycurl.WRITEFUNCTION, self.on_receive)
self.conn.perform()
def on_receive(self,data):
self.buffer += data