Ejemplo n.º 1
0
		/// <summary>
		/// Clear all custom global options and set default values.
		/// </summary>
		public void ResetDefaults() {
			DefaultTimeout = new HttpClient().Timeout;
			AllowedHttpStatusRange = null;
			HttpClientFactory = new DefaultHttpClientFactory();
			JsonSerializer = new NewtonsoftJsonSerializer(null);
			UrlEncodedSerializer = new DefaultUrlEncodedSerializer();
			BeforeCall = null;
			BeforeCallAsync = null;
			AfterCall = null;
			AfterCallAsync = null;
			OnError = null;
			OnErrorAsync = null;
		}
        public void can_serialize_object()
        {
            var vals = new {
                a = "foo",
                b = 333,
                c = (string)null,             // exclude
                d = ""
            };

            var serialized = new DefaultUrlEncodedSerializer().Serialize(vals);

            Assert.AreEqual("a=foo&b=333&d=", serialized);
        }