接口请求

 public static string PostmanPost()
        {
            var client = new RestClient("http://119.3.248.64:3000");
            var request = new RestRequest(Method.POST);
            request.RequestFormat = DataFormat.Json;
            request.AddHeader("Content-Type", "application/json");

            Myobject bean = new Myobject("console","test");

            request.AddParameter("application/json; charset=utf-8", JsonConvert.SerializeObject(bean), ParameterType.RequestBody);
            IRestResponse response = client.Execute(request);
            var responseContent = response.Content;
            return responseContent;
        }
posted @   紫心落  阅读(54)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示