Example #1
0
        void DecodeHeader(HttpResponseMessage response, Content content,
                          KeyValuePair <NSObject, NSObject> entry)
        {
            string key   = (NSString)entry.Key;
            string value = (NSString)entry.Value;

            try {
                if (content.DecodeHeader(key, value))
                {
                    return;
                }

                response.Headers.Add(key, value);
                return;
            } catch {
                ;
            }

            /*
             * FIXME: .NET automatically fixes an invalid date header
             *        by setting it to the current time.  Mono does not.
             */
            if (key.Equals("Date"))
            {
                response.Headers.Date = DateTime.Now;
            }
        }
		void DecodeHeader (HttpResponseMessage response, Content content,
		                   KeyValuePair<NSObject,NSObject> entry)
		{
			string key = (NSString)entry.Key;
			string value = (NSString)entry.Value;

			try {
				if (content.DecodeHeader (key, value))
					return;

				response.Headers.Add (key, value);
				return;
			} catch {
				;
			}

			/*
			 * FIXME: .NET automatically fixes an invalid date header
			 *        by setting it to the current time.  Mono does not.
			 */
			if (key.Equals ("Date"))
				response.Headers.Date = DateTime.Now;
		}