Improve URL encoding
[testsuite/python-testing-utils.git] / robotframework-onap / eteutils / HTTPUtils.py
1 from six.moves.urllib.parse import urlparse
2 from six.moves import urllib
3
4 import urllib3
5
6
7 class HTTPUtils:
8     """HTTPUtils is common resource for simple http helper keywords."""
9
10     def url_encode_string(self, barestring):
11         """URL Encode String takes in a string and converts it into fully 'percent-encoded' string"""
12         return urllib.parse.quote(barestring)
13
14     def disable_warnings(self):
15         """  Disable all warnings when creating sessions """
16         urllib3.disable_warnings()
17
18     def url_parse(self, url):
19         """  Get pieces of the URL """
20         return urlparse(url)