diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2020-02-03 16:32:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 16:32:00 +0300 |
commit | f42fe9916704c31e95b8f25dba2410e6afe66bc1 (patch) | |
tree | 9c14fbe1b73627d98aa1a9ce438590f868f6c16e /collectors | |
parent | 31675045e99975fc2599d13b92a93269e7983743 (diff) |
/pythond.d/UrlService.py: add body (#7956)
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/python.d.plugin/python_modules/bases/FrameworkServices/UrlService.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/collectors/python.d.plugin/python_modules/bases/FrameworkServices/UrlService.py b/collectors/python.d.plugin/python_modules/bases/FrameworkServices/UrlService.py index 76ae69aa3a..f72d70d267 100644 --- a/collectors/python.d.plugin/python_modules/bases/FrameworkServices/UrlService.py +++ b/collectors/python.d.plugin/python_modules/bases/FrameworkServices/UrlService.py @@ -47,6 +47,7 @@ class UrlService(SimpleService): self.proxy_url = self.configuration.get('proxy_url') self.method = self.configuration.get('method', 'GET') self.header = self.configuration.get('header') + self.body = self.configuration.get('body') self.request_timeout = self.configuration.get('timeout', 1) self.respect_retry_after_header = self.configuration.get('respect_retry_after_header') self.tls_verify = self.configuration.get('tls_verify') @@ -141,6 +142,9 @@ class UrlService(SimpleService): if hasattr(retry, 'respect_retry_after_header'): retry.respect_retry_after_header = bool(self.respect_retry_after_header) + if self.body: + kwargs['body'] = self.body + response = manager.request( method=self.method, url=url, |