httpwebrequest

    1熱度

    2回答

    我想從soundcloud API得到迴應。這是我的代碼。 public static async Task<string> GetTheGoodStuff() { var client = new HttpClient(new NativeMessageHandler()); var response = await client.GetAsync("http://

    0熱度

    1回答

    我目前正試圖提交一個包含多個文件到其目標服務器的表單,但不知道如何使用HttpWebRequest發送此表單數據。該表單是MultipartFormDataContent類型。到目前爲止,我已經看到了使用HttpWebRequest提交表單的方法,但是這是通過將表單構造爲字符串並將其轉換爲字節數組來完成的。因此,像這樣, string postData = ""; foreach (

    0熱度

    2回答

    我想將其轉換爲處理異常的並行編程。 public List<ExcelRecord> GetReport(List<ExcelRecord> records, string type) { foreach (ExcelRecord rec in records) { CheckHealth(rec); } retu

    0熱度

    1回答

    我有用於Windows Mobile 6.5終端的CSharp應用程序(CF2.0)。 我有一個線程,每1.5分鐘嘗試連接到一個PHP WebService。我嘗試用ReadToEnd()方法讀取此PHP WebService的響應。 它可以工作,但有時(隨機)ReadToEnd()上的例程塊。我不知道爲什麼。 這是代碼: public static string CallWebServicePr

    0熱度

    1回答

    我用下面的代碼有錯誤的請求: HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://xxxxxxx"); request.Headers.Add("xxxxxxxxxxxxxxxxx"); request.ContentType = "application/x-www-form-url

    2熱度

    1回答

    如何使用相同的服務發出多個請求? 我創建了一個靜態的HttpWebRequest: private static HttpWebRequest request; //private static StreamReader streamReader; //private StreamWriter streamWriter; public CentralRestServ

    0熱度

    1回答

    嗨,我想從一個文件夾使用web服務發送xml文件到我的本地計算機中的另一個文件夾, 文件發送成功,應用程序正常關閉,但問題是,文件需要永遠修改目標文件夾,當我嘗試再次調用webservice時,它會讓我異常超時。 這裏是我的代碼 public void SendC_XML(string path, string queueID, string application, string service

    0熱度

    1回答

    我有我需要使用的web api。 這個API將根據我發送的內容類型返回數據。 通常它會返回html響應。 如果請求具有Content-Type頭和'application/json'頭,它將返回一個json響應。 當我嘗試使用Postman並添加內容類型頭(作爲application/json)時,一切都很好。 但是,當使用C#WebRequest對象嘗試它時,無論我使用的是什麼內容類型的標頭,我

    0熱度

    1回答

    我使用Kodi API,通過asp.net控制我的htpc。特別是名爲「Playlist.Add」的功能。 JSON的我送是這樣的: {"jsonrpc":"2.0","method":"Playlist.Insert","params":{"playlistid":0,"position":0,"item":{"file":"smb://server/Ferry Corsten/Beautifu

    3熱度

    1回答

    我正在製作一個asp.net網頁表單應用程序,該應用程序提供使用paypal付款。該應用程序應該使用ssl。當我運行我的應用程序一切順利,直到我選擇我的按鈕paypal支付。當我按下這個按鈕,會出現以下錯誤: The request was aborted: Could not create SSL/TLS secure channel. Description: An unhandled exc