Exemple #1
0
        /// <summary>
        /// Gets a POST body for a snap to road request.
        /// </summary>
        /// <returns>A POST body for a snap to road request.</returns>
        private string GetPostRequestBody()
        {
            var sb = new StringBuilder();

            sb.Append("{");

            sb.AppendFormat("\"agents\":[{0}],", string.Join(",", Agents));
            sb.AppendFormat("\"itineraryItems\":[{0}],", string.Join(",", ItineraryItems));

            sb.AppendFormat("\"type\":\"{0}\",", Enum.GetName(typeof(OptimizationType), Type));
            sb.AppendFormat("\"roadnetwork\":{0},", RoadNetwork.ToString().ToLowerInvariant());
            sb.AppendFormat("\"costvalue\":\"{0}\"", Enum.GetName(typeof(CostValueType), CostValue));

            sb.Append("}");

            return(sb.ToString());
        }