def rest_post(url, data, timeout, show_error=False):
    '''Call rest post method'''
    try:
        response = requests.post(url, headers={'Accept': 'application/json', 'Content-Type': 'application/json'},\
                                 data=data, timeout=timeout)
        return response
    except Exception as exception:
        if show_error:
            print_error(exception)
        return None
def rest_post ( url , data , timeout , show_error = False ) : try : response = requests . post ( url , headers = { 'Accept' : 'application/json' , 'Content-Type' : 'application/json' } , data = data , timeout = timeout ) return response except Exception as exception : if show_error : print_error ( exception ) return None
Call rest post method