Ejemplo n.º 1
0
        public void SendEventsToAlice(int id)
        {
            var url    = "https://alice.digital:6984" + "/events";
            var client = new HttpClient();

            var data = new AliceInsurance(id.ToString());
            var body = MyJsonSerializer.SerializeToJsonString(data);

            var request = new HttpRequestMessage(HttpMethod.Post, url);

            request.Content = new StringContent(body, Encoding.UTF8, "application/json");
            request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            request.Headers.Authorization = new AuthenticationHeaderValue("Basic", "ZWNvbm9taWNzOno2dHJFKnJVRHJ1OA==");

            client.SendAsync(request);
        }
Ejemplo n.º 2
0
 static MyJsonSerializer()
 {
     DefaultSerializer = new MyJsonSerializer();
 }