public static Dictionary<string, string> CreateGetMeasureHttpContent(string deviceId, Scale scale, MeasurementType[] measurementTypes, string moduleId = null, bool onlyLastMeasurement = false, DateTime? begin = null, DateTime? end = null, bool optimize = true, int limit = 1024, bool realtime = false)
        {
            var content = new Dictionary<string, string>
            {
                {"device_id", deviceId },
                {"scale",  scale.GetScaleName()},
                {"type", measurementTypes.ToMeasurementTypesString() },
                {"optimize", optimize.ToString() },
            };

            if (!string.IsNullOrEmpty(moduleId))
                content.Add("module_id", moduleId);
            if (onlyLastMeasurement)
            {
                content.Add("date_end", "last");
            }
            else
            {
                if (begin.HasValue)
                    content.Add("date_begin", begin.Value.ToUtcTimestamp().ToString());
                if (end.HasValue)
                    content.Add("date_end", end.Value.ToUtcTimestamp().ToString());
            }

            if (limit != 1024)
                content.Add("limit", limit > 1024 || limit < 1 ? "1024" : limit.ToString());
            if (realtime)
                content.Add("realtime", "true");

            return content;
        }