C# 如何使用ApiClient.Default.CallApi()?

C# 如何使用ApiClient.Default.CallApi()?,c#,.net,asp.net-web-api,autodesk-forge,rest-client,C#,.net,Asp.net Web Api,Autodesk Forge,Rest Client,通过查看Autodesk.Forge参考属性,我发现了一个名为CallApiAsync()的方法,我希望使用该方法发送请求,例如获取Autodesk BIM 360项目的属性 下面是CallApiAsync()使用的参数,但是有人能解释一下它们是什么,以及我如何null我不需要的参数吗 CallApiAsync(string path, RestSharp.Method method, System.Collections.Generic.

通过查看Autodesk.Forge参考属性,我发现了一个名为CallApiAsync()的方法,我希望使用该方法发送请求,例如获取Autodesk BIM 360项目的属性

下面是CallApiAsync()使用的参数,但是有人能解释一下它们是什么,以及我如何
null
我不需要的参数吗

CallApiAsync(string path, 
             RestSharp.Method method, 
             System.Collections.Generic.Dictionary<string, string> queryParams, 
             object postBody, 
             System.Collections.Generic.Dictionary<string, string> headerParams,
             System.Collections.Generic.Dictionary<string, string> formParams,
             System.Collections.Generic.Dictionary<string, RestSharp.FileParameter> fileParams, 
             System.Collections.Generic.Dictionary<string, string> pathParams, 
             string contentType)
callapisync(字符串路径,
方法,,
System.Collections.Generic.Dictionary查询参数,
对象后体,
System.Collections.Generic.Dictionary headerParams,
System.Collections.Generic.Dictionary formParams,
System.Collections.Generic.Dictionary文件参数,
System.Collections.Generic.Dictionary路径参数,
字符串内容类型)

如果查看源代码,它不会真正检查null或返回任何默认值,因此需要为不需要的参数提供空值,例如

 CallApiAsync(“Your:Api/path/”, Method.GET, new Dictionary<string,string>(), new {}, ...)
callapisync(“您的:Api/path/”,Method.GET,new Dictionary(),new{},…)

您可以在这里查看源代码,但您可能不会直接使用它,相反,您将使用另一个调用此方法的方法,如下图所示,感谢源代码,在使用了两段代码后,我能够通过CallApiAsync()函数使我的方法按预期工作感谢源代码,这对创建CallApi函数的结构非常有帮助。