Thursday, August 31, 2023

httpclient request with Access Token and payloads:

 httpclient request with Access Token and payloads:



 var param = new

            {


                documentNumber = "1317915213594",

                motherName = "Amena",

                dateOfBirth = "01/23/1985"


            };

var dataString = JsonConvert.SerializeObject(param);

            string accessToken_ = userDatas.accessToken;


            var client = new HttpClient();

            var request = new HttpRequestMessage(HttpMethod.Post, "http://104.198.53.36:8080/UW/app/erp/duplicationCheck");

            request.Headers.Add("Authorization", accessToken_);

            var content_ = new StringContent(dataString, null, "application/json");

            request.Content = content_;

            var response_ = await client.SendAsync(request);

            response_.EnsureSuccessStatusCode();


No comments:

Post a Comment

Screen Record

 Windows Screen Record WindowsKey+ Alt + R Recording Starts.