Код: Выделить всё
$.ajax({
url: "your_api_endpoint", // The URL to send the request to
method: "GET", // HTTP method (GET, POST, PUT, DELETE, etc.)
data: { // Data to be sent to the server (optional)
param1: "value1",
param2: "value2"
},
dataType: "json", // Expected data type of the response (json, xml, text, html)
success: function(response) {
// Function to execute on successful request
console.log("Success:", response);
},
error: function(jqXHR, textStatus, errorThrown) {
// Function to execute on request error
console.error("Error:", textStatus, errorThrown);
},
complete: function() {
// Function to execute after the request completes (success or error)
console.log("Request complete.");
}
});
Модуль фильтрации запросов настроен на отклонение запроса, если строка запроса слишком длинная.
Все решения, которые я искал, где изменить файл web.config. В моем проекте нет файла web.config. Это приложение .NET Core. Могу ли я решить эту проблему в файле appsettings.json?
Я установил
Код: Выделить всё
return new WebHostBuilder()
.UseKestrel(opt =>
{
opt.AddServerHeader = false;
//opt.Limits.MaxRequestLineSize = 16 * 1024;
opt.Limits.MaxRequestLineSize = 302768;
})
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIIS()
.UseIISIntegration()
.UseStartup();
"Limits": {
"MaxRequestLineSize": 302768 // Пример: 8 КБ (по умолчанию)
// Вы можете увеличить это значение по мере необходимости, например, 16384 для 16 КБ
}
} в файле appsetting.json, и это не работает
Подробнее здесь: https://stackoverflow.com/questions/798 ... ed-to-deny
Мобильная версия