Every time I attempt to call a lengthy URL, I encounter a Bad Request issue.
https://localhost:44320/RespostaEmail/96635/750396/[%7B%22IdItem%22:8,%22IdTipoReposta%22:80%7D,%7B%22IdItem%22:1,%22IdTipoReposta%22:80%7D,%7B%22IdItem%22:3,%22IdTipoReposta%22:80%7D,%7B%22IdItem%22:2,%22IdTipoReposta%22:80%7D,%7B%22IdItem%22:5,%22IdTipoReposta%22:80%7D,%7B%22IdItem%22:7,%22IdTipoReposta%22:80%7D,%7B%22IdItem%22:10,%22IdTipoReposta%22:80%7D,%7B%22IdItem%22:4,%22IdTipoReposta%22:80%7D,%7B%22IdItem%22:6,%22IdTipoReposta%22:80%7D,%7B%22IdItem%22:9,%22IdTipoReposta%22:80%7D]
Each time the JavaScript function is called, it redirects me to this URL
function responder(idDivergencia, numGF, dia, mes, ano) {
let observacao = $('#observacao').val();
if (observacao.trim() == '') {
abrirDialogAlertaMensagem('Informe uma observação para visualizar a tela de resposta.');
return;
}
while (observacao.indexOf('/') != -1) {
observacao = observacao.replace('/', '-')
}
var lista = ObterListaDeItens(idDivergencia, numGF);
var itens;
if (lista != null) {
$('.btnSalvarDiv').click();
itens = JSON.stringify(lista);
window.location.href = RELATIVE_PATH + 'RespostaEmail/' + idDivergencia + '/' + numGF + '/' + itens
} else {
abrirDialogAlertaMensagem('Informe o(s) tipo(s) de resposta para visualizar a tela de resposta.');
return;
}
}
This is my controller code snippet
[HttpGet]
[Route("RespostaEmail/{idDivergencia}/{numeroGf}/{itensDivergencia}")]
public IActionResult RespostaEmail(int idDivergencia, int numeroGf, string itensDivergencia)
{
if (itensDivergencia == "favicon.ico")
return View();
var listaItems = JsonConvert.DeserializeObject<List<ItemResposta>>(itensDivergencia);
var breadcrumb = BreadcrumbControl.GetInstance();
breadcrumb.AddNewPage("Resposta Email", "Resposta", "RespostaEmail");
var dados = new Resposta();
var itens = _divergenciaAppService.ListarItensDivergencia(idDivergencia);
foreach (var item in itens)
{
dados.ItemSolicitado.Add(new ItemSolicitado
{
CodigoDivergencia = item.CodDivergencia,
IdGrupo = item.IdGrupo,
IdItem = item.IdItem,
Peca = item.PecaSolicitada,
Quantidade = item.QtdDivergente ?? 0,
TipoResposta = listaItems.FirstOrDefault(x => x.IdItem == item.IdItem).IdTipoReposta
});
}
dados.IdDivergencia = idDivergencia;
dados.NumeroGF = numeroGf;
var email = _respostaAppService.MontarEmailResposta(dados);
ViewBag.TextoPadrao = email;
ViewBag.IdDivergencia = idDivergencia;
ViewBag.Conta = ContaUsuario;
ViewBag.IdGrupo = dados.ItemSolicitado.Select(x => x.IdGrupo).LastOrDefault();
return View();
}
I am attempting to adjust the maximum length but cannot locate where to configure this. My project is based on .NET Core 3.1 and has a Startup file, however, I am unable to identify the solution in that file. Any alternative approaches to resolving this issue would also be appreciated.