summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/eteutils/HTTPUtils.py
blob: f5c8fe42c6b31ec36afacc1557ad167bd04f14dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from six.moves.urllib.parse import urlparse
from six.moves import urllib

import urllib3


class HTTPUtils:
    """HTTPUtils is common resource for simple http helper keywords."""

    def url_encode_string(self, barestring):
        """URL Encode String takes in a string and converts it into fully 'percent-encoded' string"""
        return urllib.parse.quote(barestring)

    def disable_warnings(self):
        """  Disable all warnings when creating sessions """
        urllib3.disable_warnings()

    def url_parse(self, url):
        """  Get pieces of the URL """
        return urlparse(url)