bversion/server.py
def success(headers: Optional[Dict[str, str]] = None, data: Union[dict, bytes, ServeFile] = b''):
    """ Generate success JSON to send to client """
    passed_headers: Dict[str, str] = {} if headers is None else headers
    if isinstance(data, dict): data = json.dumps(data).encode('utf8')
    ret_headers = {'status' : 'ok'}
    ret_headers.update(passed_headers)
    return server_responce(ret_headers, data)
 Generate success JSON to send to client 
Generate success JSON to send to client
Generate success JSON to send to client
def success(headers: Optional[Dict[str, str]] = None, data: Union[dict, bytes, ServeFile] = b''):
    passed_headers: Dict[str, str] = {} if headers is None else headers
    if isinstance(data, dict): data = json.dumps(data).encode('utf8')
    ret_headers = {'status' : 'ok'}
    ret_headers.update(passed_headers)
    return server_responce(ret_headers, data)
def success ( headers : Optional [ Dict [ str , str ] ] = None , data : Union [ dict , bytes , ServeFile ] = b'' ) : passed_headers : Dict [ str , str ] = { } if headers is None else headers if isinstance ( data , dict ) : data = json . dumps ( data ) . encode ( 'utf8' ) ret_headers = { 'status' : 'ok' } ret_headers . update ( passed_headers ) return server_responce ( ret_headers , data )
Generate success JSON to send to client
Generate success JSON to send to client
""" Generate success JSON to send to client """
headers
Optional[Dict[str, str]]
data
Union[dict, bytes, ServeFile]