using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net.Http;
namespace UI
{
//httpMethod请求方式 delete put post get
//controllerName请求的控制器 api/BaoXiuApi
//data 需要添加或修改的数据json字符串 {'Name':'张三','Age':19}
public class HttpClientHelper
{
public static string Send(string httpMethod, string controllerName, string data)
{
HttpClient client = new HttpClient();
Uri uri = new Uri("http://localhost:55577/");
client.BaseAddress = uri;
HttpResponseMessage responseMessage = null;
switch (httpMethod)
{
case "get":
responseMessage = client.GetAsync(controllerName).Result;