From the client in angular.js I am sending this json:
{"variable": "something"}
I am learning to create web services using visual studio c #, and whenever I have tried to send a JSON, I do it in the same way as I am doing, and they are always received (The problem is in the backend, I am sure). When making the web request, the received JSON is always null. How can I solve that?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace pruebaservicioweb.Controllers
{
public class EstudianteController : ApiController
{
[HttpGet]
public dynamic ReadJSON([FromBody] dynamic parameter)
{
string json = parameter.variable;
return json;
}
}
}