Método Post não está rodando no Postman
Criando um método POST e testando pelo Postman, não consigo acessar o Controller desse POST. Não implementei ainda muita coisa, mas deveria parar no Break se, claro, estivesse funcionando. Controller
[code=csharp[Route("api/[controller]")]
public class OptOutClientController : Controller
{
private IOptOutCreateService optOutCreateService;
HttpClient httpClient = new HttpClient();
public OptOutClientController(IOptOutCreateService optOutCreateService)
{
this.optOutCreateService = optOutCreateService;
}
[HttpPost]
public async Task<IActionResult> OptOutPostClient([FromBody]OptOutRequest client)
{ **Breakpoint nessa chave e não entra **
if (client == null)
throw new OptOutException( "Favor informar os dados do OptOut!");
var result = await optOutCreateService.Process(new OptOutCreateCommand(client.Cpf, client.Email, client.Telefone, client.Bandeira, client.Canal));
return Ok(new ApiReturnItem<OptOutResult> { Item = result, Success = true });
}
}[/code]
O postman me retorna o seguinte erro: 404 - Page Not Found
Url no Postman:
http://localhost:51585/api/OptOutClient/OptOutPostClient
Json no body do Postman:
[code=csharp[Route("api/[controller]")]
public class OptOutClientController : Controller
{
private IOptOutCreateService optOutCreateService;
HttpClient httpClient = new HttpClient();
public OptOutClientController(IOptOutCreateService optOutCreateService)
{
this.optOutCreateService = optOutCreateService;
}
[HttpPost]
public async Task<IActionResult> OptOutPostClient([FromBody]OptOutRequest client)
{ **Breakpoint nessa chave e não entra **
if (client == null)
throw new OptOutException( "Favor informar os dados do OptOut!");
var result = await optOutCreateService.Process(new OptOutCreateCommand(client.Cpf, client.Email, client.Telefone, client.Bandeira, client.Canal));
return Ok(new ApiReturnItem<OptOutResult> { Item = result, Success = true });
}
}[/code]
O postman me retorna o seguinte erro: 404 - Page Not Found
Url no Postman:
http://localhost:51585/api/OptOutClient/OptOutPostClient
Json no body do Postman:
{ "Cpf" : "123456", "Email" : "j@cb.com.br", "Telefone" : "971418418", "Bandeira" : "CB", "Canal" : "EML" }
Pjava
Curtidas 0