RestRequest request = new RestRequest(Method.POST); request.AddParameter("application/json", JsonConvert.SerializeObject(new {username = "example_user", password = "example_password"}), ParameterType.RequestBody);
RestRequest request = new RestRequest(Method.POST); request.AddBody(new { username = "example_user", password = "example_password" });This example is adding a request body using the AddBody method. The method takes an object which will be serialized to the request body. In this case, an anonymous object is passed with the username and password. The library used is RestSharp.