CallWebApi
Interface Function
Call external API.
Request Parameter
Parameter | Required | Type | Remarks |
---|---|---|---|
method | true | string | Call method that supports post get delete put |
domain | true | string | domain of external API, e.g. http://www.ants.com |
url | true | string | Relative path of API, e.g. customapi/getData |
postData | false | string | Request parameter that needs to post to API |
Return Data Type
string,return value of API
Request Sample
//
var data = new {
staffCode = "##190111031015539",
organizationCode = "DemoTenant"
}
string postData=JsonHelper.Serialize(data);
var result=Service.CallWebApi("post","http://www.ants.com","DemoTenant/demoapp/customApi/GetUserInfo",postData);