Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
124 views
in Technique[技术] by (71.8m points)

c# - how to sanitize json reply from Microsoft Flow HTTP request

in my App when I send parameters on my Microsoft Flows HTTP request it sends a reply that on the JSON string below is my code. how can I get the value of the status? Am I lacking something to get the "No data met the criteria" value?

public async Task<IActionResult> SendNameAge()
        {
            using (var client = new HttpClient())
            {
                // Create new instance of Person
                Person person = new Person
                {
                    Name = SD.HTTPName, 
                    Age = SD.HTTPAge    
                };

                var personJSON = JsonConvert.SerializeObject(person);   
                var buffer = System.Text.Encoding.UTF8.GetBytes(personJSON);    
                var byteContent = new ByteArrayContent(buffer); 
                byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); 

                client.BaseAddress = new Uri(SD.ApiUri);    
                var response = await client.PostAsync(SD.ApiUri, byteContent);  

                string jsonstatus = response.Content.ReadAsStringAsync().Result;

                return Ok(response);
            }
        }

I need to get the "No data met the criteria" response from the HTTP request enter image description here

This is from the Postman test

enter image description here

question from:https://stackoverflow.com/questions/65931699/how-to-sanitize-json-reply-from-microsoft-flow-http-request

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...