如何使用 restsharp web rest api

how to use restsharp web rest api

你好我是新来的休息api 我建造这些 api https://dastanito.ir/test/ex2/api/storiesmaster/read.php https://dastanito.ir/test/ex2/api/storiesmaster/read_one.php?id=60

我在 python 中使用了请求库,一切正常

但我不知道如何将它与 restsharp 一起使用

  var client = new RestClient("https://dastanito.ir/test/ex2/api/storiesmaster/read.php");

            var request = new RestRequest("");

            var response = client.Post(request);
            MessageBox.Show(response.Content.ToString());

基于RestSharp样本:

var client = new RestClient("https://dastanito.ir");   

var request = new RestRequest("test/ex2/api/storiesmaster/read.php", Method.GET);

// execute the request
IRestResponse response = client.Execute(request);
var content = response.Content; // raw content as string

输出:

{"StoriesMasters":[{"id":"2","story_code":"002a","master_code":"he3385_1"},{"id":"60","story_code":"001a","master_code":"he3385_1"},{"id":"3","story_code":"c57675","master_code":"ara3433_2"},{"id":"50","story_code":"d8885","master_code":"za76787_3"}]}