Http Integration in C#

private async Task SendResponseToExternalURLAsync()
{
using (var client = new HttpClient())
{

     string url = "http://localhost:8090/api/devices/55f82cdb2868217b/queue";


     var queueItem = new
     {
         confirmed = true,
         data = "68656C6C6F20776F726C64",
         fCntDown = 1,
         fPort = 1,
         id = "55f82cdb2868217b",

     };


     var jsonContent = JsonConvert.SerializeObject(new { queueItem });


     client.DefaultRequestHeaders.Add("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJjaGlycHN0YWNrIiwiaXNzIjoiY2hpcnBzdGFjayIsInN1YiI6IjMxOGZkYmEyLWEzNGUtNDZhOS04MDlmLWFjN2Q4Njg0MDdjYyIsInR5cCI6ImtleSJ9.R0FmwwuYbwbO_d0yKZ1aUzmuElRdTOs-HvLXbY37clc");


     client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

     return await client.PostAsync(url, new StringContent(jsonContent, Encoding.UTF8, "application/json"));
 }

}
here I am sending downlink, so my question is what I am asked to data json data in downlink

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.