/// <summary> /// Show current request /// </summary> protected void ShowCurrentRequest() { try { var request = ProgramStorageQueries.GetCurrentRequest(); var key = ProgramStorageQueries.GetRequestKey(request); CMD.ShowApplicationMessageToUser($"{key}\t{request.RequestUri}"); } catch (Exception e) { CMD.ShowApplicationMessageToUser($"message : {e.Message}\nroute : {this.ToString()}", showType: ShowType.DANGER); } }
/// <summary> /// copy all headers of request in variables list /// </summary> /// <param name="variableName">The name of the variable that holds the config</param> /// <param name="targets">defined header</param> /// <param name="key">request key</param> protected void CopyRequestConfig(string variableName, string targets = null, string key = null) { try { var request = ProgramStorageQueries.GetCurrentRequest(); if (targets == null) { var properties = CopyConfig(request); VariablesStorageQueries.AddNewVariable(variableName, properties); } else { var properties = CopyConfig(request, targets); VariablesStorageQueries.AddNewVariable(variableName, properties); } } catch (Exception e) { CMD.ShowApplicationMessageToUser($"message : {e.Message}\nroute : {this.ToString()}", showType: ShowType.DANGER); } }