我正在構建Windows Phone 7 Silverlight應用程序。是否有理由使用RestSharp而不是WebClient?我在RestSharp網站上四處瀏覽,但它的好處並不明顯。RestSharp v。WebClient?
13
A
回答
19
RestSharp刪除以下痛點:
- 怪癖在.NET的HTTP類(基本認證被破壞,錯誤處理對於非200的響應,等等)
- 從響應數據自動反序列化到波蘇斯
- 簡化的API(
request.AddParameter(name, value)
,而不是手動編譯請求體) - 簡化的請求/響應語義,尤其是異步(但是,它是異步的,並且可能不符合每個人的需求,其中ca本身我也建議評估Hammock)
反序列化可能是因爲對於大多數的API,你不必做很多來獲取XML或JSON到C#對象的最大漲幅。
我想看看這些網頁獲取更多信息
https://github.com/restsharp/RestSharp/wiki https://github.com/restsharp/RestSharp/wiki/RestSharp-Blog-Posts-and-Links
隨意張貼在這裏有任何疑問或對Google Group
+0
這些鏈接已經死亡。有什麼機會可以更新它們? – 2015-01-13 19:47:10
+0
嗨,John,請確認,Windows服務中可以使用Restsharp嗎?或WinHttp唯一的選擇? – ivorykoder 2016-09-22 13:22:38
相關問題
- 1. 翻譯捲曲restsharp
- 2. RestSharp如何
- 3. RestSharp上的FileNotFoundException
- 4. RestSharp - 找不到
- 5. RestSharp請求
- 6. MonoDroid&RestSharp,MethodMissingException
- 7. RestSharp send Dictionary
- 8. RestSharp異步PUT
- 9. RestSharp JSON Serializating C#
- 10. Desk.com和RestSharp(oAuth)
- 11. Hoptoad v。Exceptional v。exception_notification v。exception_logger
- 12. WebClient TimeOut
- 13. WebClient UploadString
- 14. WebClient StatusCode
- 15. Windows Phone 7.1 WebClient POST無身體
- 16. Instagram到TableView w/RestSharp
- 17. RestSharp JSON序列化
- 18. RestSharp:轉換結果
- 19. restsharp不成功後
- 20. 如何使用RestSharp
- 21. RESTsharp獲取命令&
- 22. RESTSharp 102異步+ WP7.1
- 23. 移植捲曲-F到RestSharp
- 24. Mercurial v Git v Subversion
- 25. WebClient的頭類
- 26. WebClient卡住了?
- 27. WebClient 403禁止
- 28. C#WebClient OpenRead url
- 29. WebClient DownloadFileAsync掛起
- 30. Spring Reactive WebClient
讀者可以看看RestSharp之間[差異ServiceStack](http://stackoverflow.com/questions/10117376/)服務棧和用戶Runscope API工具的領先者 - restsharp [1]的前任負責人(http://john-sheehan.com/blog/my -net-open-source-project-management-nightmare),[2](http://haacked.com/archiv e/2013/09/18/restsharp-104-2-0-released.aspx) - 就這兩個選項給出建議。 – surfmuggle 2013-11-04 20:57:54
該文章http://www.diogonunes.com/blog/webclient-vs-httpclient-vs-httpwebrequest/推薦HttpClient for .Net 4.5+ – 2016-01-24 12:18:16