0

I've set some additional headers using

c.setopt(self.c.HTTPHEADER, ['Accept: */*', ..., ...])

Now what I want is to reset/clear that headers without destroying pycurl object or closing session.

Pablo
  • 28,133
  • 34
  • 125
  • 215

2 Answers2

0

You can reset a header setting its value to blank string

                        #   erase 2 headers and keep others
c.setopt(self.c.HTTPHEADER, ["User-Agent:","Accept:"])
SanityIO
  • 814
  • 6
  • 15
0

You can do this easily with:

c.reset()
davelupt
  • 1,845
  • 4
  • 21
  • 32