Beispiel #1
0
        public RequestMessage(RequestMessageHeader header, RequestMessageBody body,
                              FirebaseProtocol protocol = FirebaseProtocol.HTTP)
        {
            ConnectionProtocol = protocol;
            Header             = header;
            Body = body;

            _jsonSerializerSettings = new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore,
                ContractResolver  = new PropertyNameResolver()
            };
        }
Beispiel #2
0
        /// <summary>
        /// All parameters are optional, every parameter will be initialized:
        /// Header will be ready and only Body needs to be filled with neccessary data
        /// </summary>
        /// <param name="body"></param>
        /// <param name="content_type">Default is 'application/json'</param>
        /// <param name="protocol">Default is HTTP</param>
        public RequestMessage(RequestMessageBody body   = null, string content_type = "application/json",
                              FirebaseProtocol protocol = FirebaseProtocol.HTTP)
        {
            ConnectionProtocol = protocol;
            Header             = new RequestMessageHeader(content_type);
            Body = (body == null ? new RequestMessageBody() : body);

            _jsonSerializerSettings = new JsonSerializerSettings
            {
                NullValueHandling = NullValueHandling.Ignore,
                ContractResolver  = new PropertyNameResolver(),
            };
        }