aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService/Controllers/SynchronizationController.cs
blob: ce40e552f97f6246dcb2729f17b1f4e0b207d5a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using Tango.PMR.Stubs;

namespace Tango.MachineService.Controllers
{
    public class SynchronizationController : ApiController
    {
        [HttpPost]
        public async Task<CalculateResponse> Upload(CalculateRequest request)
        {
            //if (!Request.Content.IsMimeMultipartContent())
            //    throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);

            //var provider = new MultipartMemoryStreamProvider();
            //await Request.Content.ReadAsMultipartAsync(provider);
            //foreach (var file in provider.Contents)
            //{
            //    var filename = file.Headers.ContentDisposition.FileName.Trim('\"');
            //    var buffer = await file.ReadAsByteArrayAsync();
            //    //Do whatever you want with filename and its binaray data.
            //}

            //return Ok();

            return new CalculateResponse() { Sum = request.A + request.B };
        }
    }
}