本人程式員小白,最近在用own cloud開源代碼做專案,在呼叫WebApi 的時候出現如下錯誤:
我是用C#寫的,
string res = await clients.GetStringAsync("https://admin:admin@localhost:10000/owncloud.com/ocs/v1.php/apps/yourapp");
結果運行的時候出現錯誤,希望大神能幫我解決一下
用戶代碼未處理 System.Net.Http.HttpRequestException
HResult=-2146233088
Message=發送請求時出錯。
Source=mscorlib
StackTrace:
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
在 ownCloud.Program.<GetData>d__2.MoveNext() 位置 d:\專案\ownCloud\ownCloud\Program.cs:行號 52
InnerException: System.Net.WebException
HResult=-2146233079
Message=基礎連接已經關閉: 發送時發生錯誤。
Source=System
StackTrace:
在 System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
在 System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
InnerException: System.IO.IOException
HResult=-2146232800
Message=由于意外的資料包格式,握手失敗。
Source=System
StackTrace:
在 System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
在 System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
在 System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
InnerException:
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/126651.html
標籤:Windows客戶端使用
