:tocdepth: 3 :py:mod:`gws.lib.net` ===================== .. py:module:: gws.lib.net **Source code:** :source:`gws.lib.net` Package Contents ---------------- .. py:function:: add_params(url: str, params: dict = None, **kwargs) -> str .. py:exception:: Error Bases: :py:obj:`gws.Error` Generic GWS error. .. py:function:: extract_params(url: str) -> tuple[str, dict] .. py:function:: http_request(url, **kwargs) -> HTTPResponse .. py:exception:: HTTPError Bases: :py:obj:`Error` Generic GWS error. .. py:class:: HTTPResponse(ok: bool, url: str, res: requests.Response = None, text: str = None, status_code=0) .. py:property:: text :type: str .. py:attribute:: ok .. py:attribute:: url .. py:method:: raise_if_failed() .. py:function:: is_abs_url(url) .. py:function:: make_qs(x) -> str Convert a dict/list to a query string. For each item in x, if it's a list, join it with a comma, stringify and in utf8. :param x: Value, which can be a dict'able or a list of key,value pairs. :returns: The query string. .. py:function:: make_url(u: Optional[Url | dict] = None, **kwargs) -> str .. py:function:: parse_qs(x) -> dict .. py:function:: parse_url(url: str, **kwargs) -> Url Parse a string url and return an Url object .. py:function:: quote_param(s: str) -> str .. py:function:: quote_path(s: str) -> str .. py:exception:: Timeout Bases: :py:obj:`Error` Generic GWS error. .. py:function:: unquote(s: str) -> str .. py:class:: Url(*args, **kwargs) Bases: :py:obj:`gws.Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: fragment :type: str .. py:attribute:: hostname :type: str .. py:attribute:: netloc :type: str .. py:attribute:: params :type: dict .. py:attribute:: password :type: str .. py:attribute:: path :type: str .. py:attribute:: pathparts :type: dict .. py:attribute:: port :type: str .. py:attribute:: qsl :type: list .. py:attribute:: query :type: str .. py:attribute:: scheme :type: str .. py:attribute:: url :type: str .. py:attribute:: username :type: str