Add ability to define custom interceptors (fixes #35)

This commit is contained in:
Felix Pojtinger
2021-04-27 20:16:33 +02:00
committed by Christoph Polcin
parent 8244b5a5f5
commit 4145fa842c
2 changed files with 14 additions and 4 deletions

View File

@@ -43,6 +43,10 @@ func (c *Client) req(method, path string, body io.Reader, intercept func(*http.R
intercept(r)
}
if c.interceptor != nil {
c.interceptor(method, r)
}
rs, err := c.c.Do(r)
if err != nil {
return nil, err