Guest User

Guest User

  • Tech Writer
  • 98
  • 26.8k

Consume API with parameter on POST

Jan 23 2021 2:33 PM
Using the code below I try to consume an API but I don't how to pass the parameter to post or save the model.
 
What code should I write?
  1. var product = new List<ProductModel>();  
  2. var client = new RestClient($"https://localhost:77321/Product/Create");  
  3. var request = new RestRequest(Method.POST);  
  4. IRestResponse response = await client.ExecuteAsync(request);  

Answers (3)