There are two major problems when supplying opts.stream for curl methods:
curl methods produce junk in temp folder. Curl command dumps
headers to some file in tmp folder and cleans it up only in the
parse.response() method. This method is not called if
opts.stream is set
there is no way to access response code, because it is also written to
the headers dump file in temp folder.
This PR address both of those problems by setting job.on_exit callback
even if opts.stream is provided. Methods themselves still return job, but
now user has an option to also set opts.callback to inspect the response
and curl cleans up the junk in temp folder
There are two major problems when supplying
opts.stream
for curl methods:parse.response()
method. This method is not called ifopts.stream
is setThis PR address both of those problems by setting
job.on_exit
callback even ifopts.stream
is provided. Methods themselves still return job, but now user has an option to also setopts.callback
to inspect the response and curl cleans up the junk in temp folder