synapse/http/servlet.py
def parse_string(request, name, default=None, required=False,
                 allowed_values=None, param_type="string"):
    """Parse a string parameter from the request query string.

    Args:
        request: the twisted HTTP request.
        name (str): the name of the query parameter.
        default (str|None): value to use if the parameter is absent, defaults
            to None.
        required (bool): whether to raise a 400 SynapseError if the
            parameter is absent, defaults to False.
        allowed_values (list[str]): List of allowed values for the string,
            or None if any value is allowed, defaults to None

    Returns:
        str|None: A string value or the default.

    Raises:
        SynapseError if the parameter is absent and required, or if the
            parameter is present, must be one of a list of allowed values and
            is not one of those allowed values.
    """
    return parse_string_from_args(
        request.args, name, default, required, allowed_values, param_type,
    )
Parse a string parameter from the request query string.

    Args:
        request: the twisted HTTP request.
        name (str): the name of the query parameter.
        default (str|None): value to use if the parameter is absent, defaults
            to None.
        required (bool): whether to raise a 400 SynapseError if the
            parameter is absent, defaults to False.
        allowed_values (list[str]): List of allowed values for the string,
            or None if any value is allowed, defaults to None

    Returns:
        str|None: A string value or the default.

    Raises:
        SynapseError if the parameter is absent and required, or if the
            parameter is present, must be one of a list of allowed values and
            is not one of those allowed values.
    
Parse a string parameter from the request query string.
Args:
request: the twisted HTTP request.
name (str): the name of the query parameter.
default (str|None): value to use if the parameter is absent, defaults
to None.
required (bool): whether to raise a 400 SynapseError if the
parameter is absent, defaults to False.
allowed_values (list[str]): List of allowed values for the string,
or None if any value is allowed, defaults to None

str|None: A string value or the default.

SynapseError if the parameter is absent and required, or if the
parameter is present, must be one of a list of allowed values and
is not one of those allowed values.
Parse a string parameter from the request query string . Args : request : the twisted HTTP request . name ( str ) : the name of the query parameter . default ( str|None ) : value to use if the parameter is absent defaults to None . required ( bool ) : whether to raise a 400 SynapseError if the parameter is absent defaults to False . allowed_values ( list [ str ] ) : List of allowed values for the string or None if any value is allowed defaults to None str|None : A string value or the default . SynapseError if the parameter is absent and required or if the parameter is present must be one of a list of allowed values and is not one of those allowed values .
def parse_string(request, name, default=None, required=False,
                 allowed_values=None, param_type="string"):
    return parse_string_from_args(
        request.args, name, default, required, allowed_values, param_type,
    )
def parse_string ( request , name , default = None , required = False , allowed_values = None , param_type = "string" ) : return parse_string_from_args ( request . args , name , default , required , allowed_values , param_type , )
Parse a string parameter from the request query string.
Parse a string parameter from the request query string .
"""Parse a string parameter from the request query string.

    Args:
        request: the twisted HTTP request.
        name (str): the name of the query parameter.
        default (str|None): value to use if the parameter is absent, defaults
            to None.
        required (bool): whether to raise a 400 SynapseError if the
            parameter is absent, defaults to False.
        allowed_values (list[str]): List of allowed values for the string,
            or None if any value is allowed, defaults to None

    Returns:
        str|None: A string value or the default.

    Raises:
        SynapseError if the parameter is absent and required, or if the
            parameter is present, must be one of a list of allowed values and
            is not one of those allowed values.
    """
request
name
default
required
allowed_values
param_type