-
StackOverflow 文档
-
web-services 教程
-
使用 C#.net 和 Xamarin 应用程序开发以编程方式调用 Web 服务
-
强制制作方法 GET 或 POST
/* By Default if you send only url then automatically it will recognize as GET Method and if service having parameters with, Then automatically will convert to POST Method. But I observed some of the services having only URL but are POST Type. For the purpose you can forcefully make the method as you want. As bellow: */
/// <summary>
/// If you want make the service call GET OR POST forcefully then
/// </summary>
/// <returns> Json formated data </returns>
public void GetJsonData5()
{
IOperations _Obj = ClsOperations.GetOperations();
string url = "http://1.2.3.4:1234/Services/rest/CallService/WebRequest/";
string inputjson = "{\"@FirstParameter\": \"Value1\",\"@SecondParameter\": \"Value2\",\"@ThirdParameter\": \"Value3\"}";
string _result = _ Obj.GetJsonResult(url, null, inputjson, ServiceType.POST);;
}