I'm using PycURL to send multiple request to a specific API, before my service is running I'm sending a dummy request using PycURL.perform()
To avoid printing into the console I'm using
PycURL.setopt(PycURL.WRITEFUNCTION, noop_write_function)
Now after I get a response I need I want to avoid the write function overhead so I'm trying to use unsetopt()
but it doesn't seems to work.
Whats the good practice to restore the null value to the WRITEFUNCTION?
Part of the script:
c = pycurl.Curl()
c.setopt(c.URL, 'https://someurl.com')
# send demo http request to open connection with keep alive flag
c.setopt(c.WRITEFUNCTION, noop_write_function)
c.perform()
# actually writing data to bytesIO
buffer = BytesIO()
c.setopt(c.WRITEDATA, buffer)
c.perform()
Thanks, Hod