osnapi/core.py
def generate_headers(requires_auth:bool) -> Dict:
    """ Return Headers to be used in HTTP requests.
        If requires_auth, the headers will contain a login token,
        but only if a token was previously generated by calling login().
    """
    headers = {'accept'         : 'application/json',
               'accept-encoding': 'gzip, deflate',
               'content-type'   : 'application/json',
               'cache-control'  : 'no-cache'}
    if requires_auth:
        headers['Authorization'] = Settings.auth_token
    return headers
 Return Headers to be used in HTTP requests.
        If requires_auth, the headers will contain a login token,
        but only if a token was previously generated by calling login().
    
Return Headers to be used in HTTP requests.
If requires_auth, the headers will contain a login token,
but only if a token was previously generated by calling login().
Return Headers to be used in HTTP requests . If requires_auth the headers will contain a login token but only if a token was previously generated by calling login () .
def generate_headers(requires_auth:bool) -> Dict:
    headers = {'accept'         : 'application/json',
               'accept-encoding': 'gzip, deflate',
               'content-type'   : 'application/json',
               'cache-control'  : 'no-cache'}
    if requires_auth:
        headers['Authorization'] = Settings.auth_token
    return headers
def generate_headers ( requires_auth : bool ) -> Dict : headers = { 'accept' : 'application/json' , 'accept-encoding' : 'gzip, deflate' , 'content-type' : 'application/json' , 'cache-control' : 'no-cache' } if requires_auth : headers [ 'Authorization' ] = Settings . auth_token return headers
Return Headers to be used in HTTP requests.
Return Headers to be used in HTTP requests .
""" Return Headers to be used in HTTP requests.
        If requires_auth, the headers will contain a login token,
        but only if a token was previously generated by calling login().
    """
requires_auth
bool