public void InitializeEndPoint(string endpoint, Method httpMethod) { RestLogger.Info("Calling {0} for resource {1} using {2} http method", ConstUtil.BaseURI, endpoint, httpMethod.ToString()); RestClient = new RestClient(ConstUtil.BaseURI); RestRequest = new RestRequest(endpoint, httpMethod); }
public void InitializeEndPoint(string endpoint, Method httpMethod, string employeeJson) { RestLogger.Info("Calling {0} for resource {1} using {2} http method", ConstUtil.BaseURI, endpoint, httpMethod.ToString()); RestClient = new RestClient(ConstUtil.BaseURI); RestRequest = new RestRequest(endpoint, httpMethod); RestRequest.AddParameter(ConstUtil.JSONHeaderParameter, employeeJson, ParameterType.RequestBody); }
public void DeleteEmployee() { try { RestResponse = RestClient.Execute(RestRequest); RestLogger.Info("Response received is : {0}", RestResponse.Content.ToString()); EmployeeDeleteResponse = JsonConvert.DeserializeObject <EmployeeDeleteResponse>(RestResponse.Content.ToString()); } catch (Exception ex) { RestLogger.Error(ex.Message); } }