Example #1
0
        public void sendStarMapDistance(string systemName, string remoteSystemName, decimal distance)
        {
            var client  = new RestClient(baseUrl);
            var request = new RestRequest(Method.POST);

            request.Resource = "api-v1/submit-distances";

            StarMapData       data       = new StarMapData(commanderName, systemName, remoteSystemName, distance);
            StarMapSubmission submission = new StarMapSubmission(data);

            request.JsonSerializer = NewtonsoftJsonSerializer.Default;
            request.RequestFormat  = DataFormat.Json;
            request.AddBody(submission);

            var clientResponse = client.Execute <StarMapDistanceResponse>(request);
            StarMapDistanceResponse response = clientResponse.Data;
        }
Example #2
0
 public StarMapSubmission(StarMapData data)
 {
     this.data = data;
 }