public IRestResponse Run(Step step, ScenarioContext context) { var apiStep = (ApiOptionsStep)step; var client = new RestClient(apiStep.Host); var restRequest = BuildRequest(apiStep); return client.Options(restRequest); }
public static void Main(string[] args) { var client = new RestClient("http://127.0.0.1:8080/api/"); client.Options (new RestRequest () {RequestFormat = DataFormat.Json, }); var user = new { username = "******", password = "******", passwordConfirm = "hej%Hej123" }; var request = new RestRequest("user/register", Method.POST); request.RequestFormat = DataFormat.Json; request.AddBody(user); Console.WriteLine (request.ToString ()); IRestResponse response = client.Execute(request); Console.WriteLine (response.Content); Console.ReadKey (); }