Esempio n. 1
0
        public async Task <ActionResult <Reciept> > SubmitOTP(OTPTemplate otp)
        {
            var receipt = await Submit(otp);

            Reciept reciepts = JsonConvert.DeserializeObject <Reciept>(receipt);

            return(reciepts);
        }
Esempio n. 2
0
 private async Task <string> Submit(OTPTemplate otp)
 {
     try
     {
         HttpClient client = new HttpClient();
         client.DefaultRequestHeaders.Add("Authorization", key);
         var url = urlBase + "/submit_otp";
         HttpResponseMessage httpResponse = new HttpResponseMessage();
         var json = JsonConvert.SerializeObject(otp);
         return(await GetContent(httpResponse, json, url, client));
     }
     catch (Exception e)
     {
         return(e.Message);
     }
 }