In my post request I need to send data as follows:
{
"LoginData":{
"name": "xyz",
"password": "pw"
}
}
I have not seen an example of such a header (two levels json)
You can use HttpClient
to achieve this. where you have to create C# class of your json format, you can do it from here. and then serialize your c# object using newtonsoft.json
and then use PostAsync
method of HttpClient
.