Pick up json from the postman and play on an object

0

I have POST and I use Postman to test. Amount to url and body in Postman . Now when I test my object on my Controller it comes NULL , and of course it's because I did not do it correctly. What do I have to do? Controller

[Route("api/[controller]")]
public class OptoutClientController : Controller
{
    HttpClient client = new HttpClient();

    [HttpPost]
    public IActionResult Unsubscribe([FromBody]OptOutCliente cliente)
    { 
        return Ok();
    }

}

Model

public class OptOutCliente
{
    public Int64 Cpf { get; set; }
    public String Email { get; set; }
    public String Telefone { get; set; }
    public String Bandeira { get; set; }
    public String Canal { get; set; }
}

Postman Body

{
"Cpf": "128907",
"Email": "[email protected]"
"Telefone": "971418418",
"Bandeira": "CB",
"Canal": "EML"

}

How do I get this gold json side, in my controller?

EDIT1

Postman

    
asked by anonymous 20.06.2018 / 20:39

1 answer

0

Resolved:

My json was wrong, missing a comma after the email. I just found it odd that Postman did not scream, he rolled around quietly. I thought of everything except the Postman, for he rolled over and I thought he was right. I did not notice the red "X" in it.

A friend told me like this: " When you try everything and do not find a solution, it's because the problem is a boring, usually lacking attention."

    
20.06.2018 / 23:31