Click here to Skip to main content
14,268,298 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am passing a single json string as Request in postman tool. I am able to hit the API Call but the value is coming as null.

In Postman I am passing Json single string as below:
{
"AuthenticationSSO":{
"User_Id": "Alex",
"Channel_ID": "IB",
"System_ID": "WPS",
"Reference_No": "IB120219100107" as body in postman 
}
}


But on running the same the req API json is coming null. I am able to get the successfull response on passing code level hardcoded as below for a check.

What I have tried:

I am able to get the successfull response on passing code level hardcoded as below for a check where the json oontent being passed from it . 

strSSOReqJson = "{\"AuthenticationSSO\":";
                strSSOReqJson += "{\"User_Id\":\"Alex\",\"Channel_ID\":\"IB\",\"System_ID\":\"WPS\",\"Reference_No\":\"IB120219100107\"}}";
                //strSSOReqJson = strSSOReqJson.Replace("{\"AuthenticationSSO\":", "");

            
                  
       
                    strSSOReqJson = strSSOReqJson.Replace("{\"AuthenticationSSO\":", "");
                    strSSOReqJson = strSSOReqJson.Remove(strSSOReqJson.Length - 1);
Posted
Comments
Richard Deeming 31-May-19 8:23am
   
The JSON you're passing from Postman and the JSON you're passing from C# are not the same. The first has a wrapper object, with a property called AuthenticationSSO; the second doesn't.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100