文档签名 |为什么 API 返回 "resource does not support http method 'POST'" | C#
Docusign | Why is API returning "resource does not support http method 'POST'" | C#
我正在尝试将文件上传到 springCM 并收到此消息:
"The requested resource does not support http method 'POST'."
到达终点:
....springcm.com/v201411/folders/{folderGUID}/documents
与他们的文档匹配:
名称是可选的,但我已经尝试将其作为参数传递给 URL。
这是我认为相关的代码:
Uri uri = new Uri("https://....springcm.com/v201411/folders/32dsdfdb-9356-eb11-b875-45df378sdfds/documents");
Stream uploadFile = File.OpenRead(filePath + fileName);
HttpContent fileStreamContent = new StreamContent(uploadFile);
using (client = new HttpClient())
using (var formData = new MultipartFormDataContent())
{
formData.Add(fileStreamContent);
var response = await client.PostAsync(uri, formData);
if (!response.IsSuccessStatusCode)
{
Console.WriteLine(response.Content.ReadAsStringAsync().Result);
}
await response.Content.ReadAsStreamAsync();
}
我在这里做错了什么?
TIA!
您需要使用正确的子域,该子域应以 apiupload
开头。完整的 URL 应如下所示:
https://apiupload[datacenter].springcm.com/[api version]/folders/[folder identifier]/documents{?name}
更多信息:https://developers.docusign.com/docs/clm-api/clm101/content-api/
我正在尝试将文件上传到 springCM 并收到此消息:
"The requested resource does not support http method 'POST'."
到达终点:
....springcm.com/v201411/folders/{folderGUID}/documents
与他们的文档匹配:
名称是可选的,但我已经尝试将其作为参数传递给 URL。
这是我认为相关的代码:
Uri uri = new Uri("https://....springcm.com/v201411/folders/32dsdfdb-9356-eb11-b875-45df378sdfds/documents");
Stream uploadFile = File.OpenRead(filePath + fileName);
HttpContent fileStreamContent = new StreamContent(uploadFile);
using (client = new HttpClient())
using (var formData = new MultipartFormDataContent())
{
formData.Add(fileStreamContent);
var response = await client.PostAsync(uri, formData);
if (!response.IsSuccessStatusCode)
{
Console.WriteLine(response.Content.ReadAsStringAsync().Result);
}
await response.Content.ReadAsStreamAsync();
}
我在这里做错了什么? TIA!
您需要使用正确的子域,该子域应以 apiupload
开头。完整的 URL 应如下所示:
https://apiupload[datacenter].springcm.com/[api version]/folders/[folder identifier]/documents{?name}
更多信息:https://developers.docusign.com/docs/clm-api/clm101/content-api/