blob: f5c8fe42c6b31ec36afacc1557ad167bd04f14dc [file] [log] [blame]
DR695Hae6fedd2019-05-01 18:52:33 -04001from six.moves.urllib.parse import urlparse
DR695H8ad85422019-05-03 11:41:14 -04002from six.moves import urllib
DR695Hae6fedd2019-05-01 18:52:33 -04003
DR695H861eba52018-02-23 16:42:59 -05004import urllib3
DR695Hae6fedd2019-05-01 18:52:33 -04005
DR695H5fa01462017-02-15 18:21:12 -05006
7class HTTPUtils:
8 """HTTPUtils is common resource for simple http helper keywords."""
Jerry Flood96e3d062017-04-21 16:32:33 -04009
DR695H5fa01462017-02-15 18:21:12 -050010 def url_encode_string(self, barestring):
kaihlavi0932c692019-06-06 11:08:57 +030011 """URL Encode String takes in a string and converts it into fully 'percent-encoded' string"""
12 return urllib.parse.quote(barestring)
Jerry Flood96e3d062017-04-21 16:32:33 -040013
14 def disable_warnings(self):
kaihlavi0932c692019-06-06 11:08:57 +030015 """ Disable all warnings when creating sessions """
Jerry Flood9e090202017-10-27 08:29:25 -040016 urllib3.disable_warnings()
17
18 def url_parse(self, url):
DR695H861eba52018-02-23 16:42:59 -050019 """ Get pieces of the URL """
DR695H8ad85422019-05-03 11:41:14 -040020 return urlparse(url)