我有一个小任务。我需要创建一个与RPC REST服务通信的.net类库。我需要的只是基本框架。因此,如果您可以让它通过API令牌并获取登录凭据https://simplybook.me/en/api/developer-api/tab/explorer_api
The have a sample API Key I think you can use:
company: mib
API key: f43618e37b82004066d60db3431f4a06392599a6cfcafa8268bf25becc0ec7d7
您可以使用Link如下所示使用JSONRPC客户端
using (Client rpcClient = new Client("someURL"))
{
rpcClient.Headers.Add("X-Application", "MyApplicationKey");
Request request = rpcClient.NewRequest("SportsAPING/v1.0/listMarketBook");
GenericResponse response = rpcClient.Rpc(request);
if (response.Result != null)
{
JToken result = response.Result;
}
else
Console.WriteLine(string.Format("Error in response, code:{0} message:{1}",
response.Error.Code, response.Error.Message);
// Example with positional parameters
JArray parameters = JArray.Parse(@"['Small', 'Medium', 'Large' ]");
Request resuestWithPostionalParameters = rpcClient.NewRequest("SportsAPING/v1.0/listMarketBook", parameters);
// Example with named parameters
JObject namedParameters = JObject.Parse(@"{ CPU: 'Intel', }");
Request resuestWithNamedParameters = rpcClient.NewRequest("SportsAPING/v1.0/listMarketBook", namedParameters);
}