http请求的get/post并不是难事,只是silverlight中一切皆是异步,所以代码看起来就显得有些冗长了,下面这个HttpHelper是在总结 园友 的基础上,修改得来:
1 namespace SLAwb.Helper 2 { 3 public sealed class MediaType 4 { 5 /// <summary> 6 /// "application/xml" 7 /// </summary> 8 public const string APPLICATION_XML = "application/xml"; 9 10 /// <summary> 11 /// application/json 12 /// </summary> 13 public const string APPLICATION_JSON = "application/json"; 14 15 /// <summary> 16 /// "application/x-www-form-urlencoded" 17 /// </summary> 18 public const string APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded"; 19 20 } 21 }