Open comboed opened 2 years ago
I'm not sure what you mean? You want to reuse a single Request and Response multiple times? If so, then yes you can do this, but you have to call .Reset()
and re-fill the fields before you re-use it. And of course you can't use it concurrently by multiple goroutines.
I am curious about whether prebuilding the request would make a difference in performance than having to acquire it call it every request.
Example:
Then simply reusing these vars concurrently. I did attempt to try out this idea, but I failed in return as the response body would come back either empty or with the proper response. The higher the goroutines, the more the response fails. So as said before, would it make a difference if just kept acquiring the request.