I have to store the data in a BD that sends me an API, this API sends me a POST request to my server with the data as parameters Literal the documentation tells me that "the following parameters as form params"
{
"solicitud": {
"dato1": "1",
"dato2": "2",
"dato1": "3",
.
.
.
"datoN": "N",
}
}
I want to take N data for example and store it, but I can not do it. My controller has the method as follows
[HttpPost]
public string PostConfir(Dictionary<string, string>solicitud)
{
Ads.GuardaDat("Guarda", "dato24");//Aquí se manda a la BD para provar que si llega al post
try//Intento trabajar el diccionario
{
Dictionary<string, string> respS = solicitud["solicitud"];
string dat = solicitud["dato1"];//Esto me genera error
Ads.GuardaDat(dat, "dato25");
}
catch (Exception ex)
{
Ads.GuardaDat(ex.Message, "dato25"); //Esto se guarda en BD si hay error
}
return "";
}
How can I work with the data or data? Do you have to see the word form params refers to some specific parameter?