Ошибка 400 неверный запрос размер заголовка запроса или куки слишком велик что это

Интернет ― это сложная схема взаимодействия устройств. Между компьютером и сервером сайта легко могут появиться проблемы с сетью: код ошибки 400, 406, 410. В этой статье мы рассмотрим ошибку 400.

Что значит ошибка 400

Все ошибки, которые начинаются на 4, говорят о том, что проблема на стороне пользователя.

Ошибка 400 bad request переводится как «плохой запрос». Она возникает тогда, когда браузер пользователя отправляет некорректный запрос серверу, на котором находится сайт.

Чаще всего проблема действительно обнаруживается на стороне пользователя, но бывают и исключения, когда проблема на стороне провайдера или владельца сайта.

Причины появления ошибки 400

  1. Ссылка на страницу была некорректной. Если в ссылке была допущена опечатка, сайт, как правило, выдаёт ошибку 404: «Страница не найдена». Опечатку в запросе может сделать сам пользователь, который вводит URL-адрес вручную, а также владелец сайта, который размещает ссылку на странице.
  2. Используются устаревшие файлы cookies.
  3. Пользователь загружает на сайт слишком большой файл.
  4. Антивирус или брандмауэр блокирует сайт.
  5. На компьютере есть вирус, который блокирует доступ к сайту.
  6. Проблемы на стороне интернет-провайдера.

Как исправить ошибку 400

Перед тем как заниматься серьёзной настройкой устройства, проверьте правильность написания URL-адреса. Если ссылка была скопирована с сайта, попробуйте найти нужную страницу по ключевым словам. Как только вы найдёте правильную ссылку, сайт заработает.

Если причина не в этом, переходите к другим настройкам, которые описаны ниже.

Очистите файлы cookies и кэш браузера

Файлы куки и кэш созданы для того, чтобы запоминать сайты и персональные данные пользователя. За счёт этой памяти ускоряется процесс повторной загрузки страницы. Но cookies и кэш, которые хранят данные предыдущей сессии, могут конфликтовать с другим токеном сессии. Это приведёт к ошибке 400 Bad Request.

Очистите кэш браузера по инструкции и попробуйте зайти на страницу заново.

Очистить кэш и куки можно не только вручную, но и с помощью программ CCleaner и Advanced SystemCare.

CCleaner ― эффективное решение для оптимизации работы системы. За пару кликов можно очистить кэш и cookies в нескольких браузерах одновременно. Также можно быстро почистить все временные файлы, которые могут замедлять работу системы. Интуитивный интерфейс не требует специальных знаний:



Как решить ошибку 404 1

Ещё одним популярным приложением для оптимизации ПК является Advanced SystemCare. Эта программа поможет удалить ненужные файлы, очистить реестр, ускорить работу системы, освободить память и место на диске. Также она может контролировать безопасность просмотра веб-страниц, защищая конфиденциальные данные, блокируя вредоносные веб-сайты и предотвращая майнинг криптовалюты.

Очистите кэш DNS

DNS-кэш — это временная база данных вашего компьютера, которая хранит IP-адреса часто посещаемых веб-сайтов. Такая база данных ускоряет связь с сервером.

Вы можете изменить DNS, однако данные из кэша отправляют на старый IP-адрес. После очистки браузер начнёт обращаться к новому IP-адресу. Чаще всего проблема несоответствия DNS приводит к ошибке 502, но также может появиться ошибка 400.

В зависимости от вашей операционной системы очистите кэш по одной из инструкций.

  1. 1.

    Откройте командную строку. Для этого введите в поисковую строку «Командная строка» и выберите появившееся приложение:



    Как решить ошибку 404 2

  2. 2.

  3. 3.

    Дождитесь сообщения об очистке кэша:



    =932x270

  1. 1.

    Откройте терминал клавишами Ctrl+Alt+T.

  2. 2.

    Введите команду:

    Для Ubuntu:

    sudo service network-manager restart

    Для других дистрибутивов:

    sudo /etc/init.d/nscd restart
  1. 1.

    Войдите в терминал. Для этого нажмите клавиши Command + Space. Введите Терминал и нажмите на найденное приложение.

  2. 2.

    Введите команду:

    sudo killall -HUP mDNSResponder

Готово, вы очистили кэш DNS. Попробуйте заново зайти на сайт.

Измените настройки антивируса и брандмауэра

Нарушать соединение с сервером может брандмауэр или антивирус. Чтобы проверить, мешает ли соединению один из них, временно отключите ваш антивирус и брандмауэр. Если страница заработала, нужно менять настройки одного из них.


Как отключить брандмауэр на Windows 7/10

Брандмауэр ― межсетевой экран, стена, которая защищает компьютер от вторжений и от утечки информации в сеть. Многие антивирусы имеют межсетевой экран. В этом случае брандмауэр можно выключить, чтобы он не нарушал соединения с сайтами. Если в антивирусе нет межсетевого экрана, не отключайте брандмауэр без особой причины.

Чтобы отключить брандмауэр на Windows 7/10:

  1. 1.

    В левом нижнем углу экрана нажмите на иконку Лупы.

  2. 2.

    Перейдите во вкладку «Приложения» и выберите Панель управления:



    Как решить ошибку 404 4

  3. 3.

    Нажмите на Брандмауэр Защитника Windows:



    Как решить ошибку 404 5

  4. 4.

    В левом меню нажмите на Включение и отключение брандмауэра Защитника Windows:



    Как решить ошибку 404 6

  5. 5.

    В блоках «Параметры для частной сети» и «Параметры для общественной сети» отметьте пункт Отключить брандмауэр Защитника Windows. Нажмите OK:



    Как решить ошибку 404 7

Готово, вы отключили брандмауэр.

Проверка на вирусы

Вирусы на устройстве могут нарушать связь с сайтами. Отсканируйте систему антивирусной программой. Когда вирус будет найден, удалите его и перезагрузите устройство. Если вируса нет, попробуйте другой способ.

Обновите драйверы сетевых устройств

Устаревшее ПО на сетевых устройствах может генерировать неверные запросы. Установите новые драйверы для сетевого соединения.

Уменьшите размер файла

Несмотря на то что ошибки 4xx в основном вызваны проблемами на устройстве пользователя, бывают случаи, когда ошибка связана с сервером. 400 ошибка сервера возникает, когда пользователь загружает слишком большой файл на ресурс.

Создатели сайта иногда ставят ограничения на файлы, которые загружают пользователи, чтобы не занимать много места на своём сервере. Если у вас появляется ошибка 400 при загрузке файла, то, скорее всего, он больше, чем требует владелец веб-ресурса. Попробуйте уменьшить вес файла и загрузите его снова.

Проблема на стороне интернет-провайдера

Попробуйте загрузить другой веб-сайт. Если ошибка сохраняется, значит проблема может быть связана с нарушением работы сетевого оборудования. Чтобы её исправить попробуйте перезагрузить сетевое оборудование (модем, маршрутизатор) и само устройство.

Если и это не помогло, обратитесь к своему интернет-провайдеру. Максимально полно опишите проблему и действия, которые вы предпринимали. Опишите, какая у вас операционная система и браузер, используете ли брандмауэр и прокси-сервер, очистили ли вы кэш и куки, проверили ли устройство на вирусы.

Для владельца сайта

Если вы увидели, что ваш сайт выдаёт ошибку 400, проделайте все вышеперечисленные действия. Вполне возможно, что у ваших клиентов всё отображается правильно. Очень редко, но случается, что проблема всё-таки с сервером, на котором находится сайт. В этом случае обратитесь к хостинг-провайдеру, чтобы найти ошибку в настройках.

When a website fails to load, it’s simply annoying. It’s important to understand, though, why that happened so you know how to fix it.

The 4xx family of status codes is the one we’re investigating here as they relate to invalid or corrupt requests from the client.

Specifically, we’ll take a closer look at the 400 Bad Request error: what this error means, what causes it as well as some specific steps to fix the issue.

Check Out Our Video Guide To Fixing a 400 Bad Request Error

What Is a 400 Bad Request Error?

400 Bad Request error is a generic client error that occurs when the server determines that the error doesn’t fall in any of the other status code categories. This error is related to the submitted request from the client before it is even processed by the server.

What Causes the HTTP 400 Bad Request Error?

There are various root causes that can trigger the 400 Bad Request error and, even if this error isn’t specific to any particular browser or OS (operating system), the fixes do vary slightly.

Error Code 400 Bad Request Error
Error Type Client-side
Error Variations HTTP Error 400
HTTP Error 400 – Bad Request
HTTP Status 400 – Bad Request
HTTP Error 400. The request hostname is invalid
400 Bad Request
400 Bad Request. Request Header Or Cookie Too Large
Bad Request – Error 400
Bad Request – Invalid URL
Error Causes URL String Syntax Error
Corrupted Browser Cache & Cookies
DNS Lookup Cache
File Size Too Large
Generic Server Error

1. URL String Syntax Error

The HTTP error 400 can occur due to incorrectly typed URL, malformed syntax, or a URL that contains illegal characters.

This is surprisingly easy to do by mistake and can happen if a URL has been encoding incorrectly. The following link is an example of a URL containing characters the server won’t be able to process, hence a 400 Bad Request error is triggered.

https://twitter.com/share?lang=en&text=Example%20of%20malformed%%20characters%20in%20URL

Note the extra % character immediately after the word malformed in the URL. A properly encoded space should be %20 and not %%20. This is what the result looks like in the Chrome browser.

An illegal character can also trigger a 400 Bad request error. The following URL contains a { character, which is not allowed. Therefore, it results in the same type of error.

https://twitter.com/share?lang=en&text=Example%20of%20malformed{%20characters%20in%20URL

2. Corrupted Browser Cache & Cookies

Even if the URL is 100% correct, the 400 Bad Request error can still occur because of corrupted files in the browser cache or problems with expired/corrupted browser cookies.

You may have encountered a 400 Bad Request error when trying to access the admin area of your WordPress site some time after your last log in. That’s happening because of the way the cookie handling your login authentication data may have gotten corrupted and can’t successfully authenticate you as a valid user with admin privileges.

This will then result in the connection being refused and a 400 Bad Request error is triggered.

3. DNS Lookup Cache

The 400 Bad Request can happen when the DNS data stored locally is out of sync with registered DNS information.

All domain names are aliases for IP addresses. You can think of an IP address as a phone number “always calling” a specific server you want to connect to. When you first visit a website, a process called “name resolution” takes place and that’s when the domain name resolves to the specific IP address of the server.

To speed things up, these details are stored locally on your computer in the local DNS cache so the name resolution process doesn’t have to be done for every single visit for a given website. This is similar to how the browser cache works for HTML, CSS, JavaScript, media, and other files.

4. File Size Too Large

A 400 Bad Request can also occur when you try to upload a file to a website that’s too large for the upload request to be fulfilled. This is strictly related to the file size limit of the server and will vary based on how it has been set up.

Until now, we’ve focused on the 400 Bad Request error being triggered only due to client-side issues.

5. Generic Server Error

This error can sometimes be triggered because of server-side issues as well. Specifically, a 400 status code could indicate a general problem with the server, a server glitch, or other unspecified temporary issues.

If this happens when trying to connect to a third-party website, it’s really outside of your control and your best shot is to try refreshing the browser and check at regular intervals whether the issue has been fixed by the site owners.

One thing you can do to verify the issue is a server-side issue is to try loading the website on different browsers. If you want to go the extra mile, test it on an entirely different machine/device to rule out system-specific problems.

When you can’t connect to the site via any other browsers, computers, operating systems, or other devices then it’s likely to be a server-side issue. If you’d like, you can reach out to the site owner and let them know which OS, browser, and versions you were using when experienced the issue.

400 Bad Request Error: What Does It Look Like?

Most of the time a 400 Bad Request is related to client-side issues. We already saw what a 400 Bad Request error looks like in the Chrome browser.

400 bad request error in Chrome

400 bad request error in Chrome

But what about the other browsers?

400 Bad Request in Firefox

400 bad request error in Firefox

400 bad request error in Firefox

400 Bad Request in Safari

400 bad request error in Safari

400 bad request error in Safari

400 Bad Request in Microsoft Edge

400 bad request error in Microsoft Edge

400 bad request error in Microsoft Edge

As you can see, all browsers return a generic and unhelpful 400 status code message. It seems you’re pretty much left alone for finding a solution to the problem. In Firefox and Safari, it’s not even clear a 400 Bad Request error has occurred at all as the browser window is completely blank!

Fortunately, we’ve put together a series of simple steps you can take to fix the 400 Bad Request error. Let’s take a closer look at each one of these in the next section!

How to Fix 400 Bad Request Error?

Complete the steps outlined in this section to help diagnose and correct a 400 Bad Request. The proposed solutions include:

Before digging deeper on the different ways to fix the 400 Bad Request error, you may notice that several steps involve flushing locally cached data.

It’s true that if your computer didn’t cache any files or data at all, there would probably be significantly less connection error issues.

However, the benefits of caching files/data are well documented and the web browsing experience would certainly suffer if caching techniques weren’t used by browsers. When it comes to Edge Caching, for example, you can reduce by more than 50% the time required to deliver full pages to browsers.

It all comes down to a compromise between optimization and user experience, where websites try to load as quickly as possible but can occasionally be prone to errors such as a 400 Bad Request without any warning.

1. Check the Submitted URL

As this is one of the most common reasons for a 400 Bad Request error let’s start with an obvious culprit, the URL string itself. It can be very easy to include unwanted characters in the URL when entering it manually in the browser.

Check that the domain name and specific page you’re trying to access are spelled and typed correctly. Also, make sure they’re separated with forward slashes. If the URL contains special characters, make sure they have been encoded correctly and are legal URL characters.

For long URLs, you might find it easier and less error-prone, to use an online URL encoder/decoder. These type of utilities should also be able to detect illegal characters automatically in the URL as well.

Once you’re sure the URL is correct, try to access it again in the browser. If you’re still getting the 400 Bad Request error it’s time to clear some cache!

2. Clear Browser Cache

If any locally stored website files have been corrupted this can cause a 400 Bad Request error to be returned instead of the expected website content.

This includes all types of files a website needs to properly run such as:

  • HTML
  • JavaScript
  • Text/config files
  • CSS
  • Media (images, videos, audio)
  • Data files (XML, JSON)

These files are stored locally on your computer by the browser when the website is originally visited.

To fix this, the browser cache needs to be cleared.

In Chrome, click on the three-dotted icon on the right-hand corner and select the More Tools > Clear Browsing Data from the popup menu.

Clearing the browser cache menu option

Clearing the browser cache menu option

This will display the Clear browsing data window. In here, you’ll want to make sure the Cached images and files option is checked and then click on the Clear data button to clear the browser cache.

You can also choose to delete recent files for a specific time range via the Time range dropdown. However, to make sure all potentially corrupted files are removed we recommend deleting all locally stored files by selecting the All time option.

Clear browsing data options

Clear browsing data options

If you’re using an alternative browser, check this guide for clearing the browser cache for all the major browsers (Mozilla Firefox, Safari, Internet Explorer, Microsoft Edge, Opera).

3. Clear Browser Cookies

If clearing your browser cache didn’t work, then it’s time to delete the cookies too. A single website can use dozens of different cookies. If just one of them is expired or becomes corrupted, then it can be enough to trigger a 400 Bad Request.

To clear your cookies in Chrome, open up the Clear browsing data window by clicking the icon with the three dots in the top-right corner and select More Tools > Clear Browsing Data from the popup menu.

Make sure the Cookies and other site data is checked and select All time for the date range option to delete all current website cookies.

Clear browsing data options (cookies)

Clear browsing data options (cookies)

Once done, try loading the website which returned the 400 Bad Request error again. Assuming the site uses cookies, clearing them out from your browser could fix the issue as it’s often associated with corrupt or expired cookies.

To clear cookies in browsers other than Chrome please read this guide here.

4. Check if File Upload Exceeds the Server Limit

If you’re trying to upload a file to a website that’s exceeding the server file size limit, you’ll encounter a 400 Bad Request error.

You can test this out by uploading a smaller file first. If this is successful then the initial file is probably too large and you’ll need to find some way to reduce it before uploading it again.

This will depend on the type of file you’re trying to upload but there are plenty of resources available online that can help to compress large images, video, and audio files.

5. Clear DNS Cache

Another common cause of a 400 Bad Request is when local DNS lookup data becomes either corrupted or out-of-date.

Local DNS data isn’t stored by the browser but by the operating system itself. We have put together a detailed guide to clear the DNS cache for Windows and macOS operating systems.

6. Deactivate Browser Extensions

If you have browser extensions installed that affect website cookies then these could actually be the culprit here. Try temporarily disabling them to see if it makes a difference before trying to connect to the website again.

You may not have considered this could be an issue, but it’s certainly worth a try if you’ve exhausted all other options.

Experiencing a 400 Bad Request error? Check out our detailed guide on how to fix it once and for all! ❌🦊Click to Tweet

Summary

If you’re experiencing a 400 Bad Request error there are several actions you can perform to try and fix the issue.

In the vast majority of possible scenarios, a 400 Bad Request is a client-side issue caused by the submitted request to the server or a local caching issue. The solutions outlined in this article are easy to implement by anyone with minimal technical knowledge. You should be able to get your website working again in no time!

On occasions, though, a 400 Bad Request status code could hint to a generic server issue. This can be quickly diagnosed by testing the given site on different devices. If you suspect this to be a server-side error, there’s not much you can do other than keep trying to load the site at regular intervals and inform the site admin.

Ошибка 400 Bad Request – это код ответа HTTP, который означает, что сервер не смог обработать запрос, отправленный клиентом из-за неверного синтаксиса. Подобные коды ответа HTTP отражают сложные взаимоотношения между клиентом, веб-приложением, сервером, а также зачастую сразу несколькими сторонними веб-сервисами. Из-за этого поиск причины появления ошибки может быть затруднён даже внутри контролируемой среды разработки.

В этой статье мы разберём, что значит ошибка 400 Bad Request (переводится как «Неверный запрос»), и как ее исправить

  • На стороне сервера или на стороне клиента?
  • Начните с тщательного резервного копирования приложения
  • Диагностика ошибки 400 Bad Request
  • Исправление проблем на стороне клиента
    • Проверьте запрошенный URL
    • Очистите соответствующие куки
    • Загрузка файла меньшего размера
    • Выйдите и войдите
  • Отладка на распространённых платформах
    • Откатите последние изменения
    • Удалите новые расширения, модули или плагины
    • Проверьте непреднамеренные изменения в базе данных
  • Поиск проблем на стороне сервера
    • Проверка на неверные заголовки HTTP
    • Просмотрите логи
  • Отладьте код приложения или скриптов

Все коды ответа HTTP из категории 4xx считаются ошибками на стороне клиента. Несмотря на это, появление ошибки 4xx не обязательно означает, что проблема как-то связана с клиентом, под которым понимается веб-браузер или устройство, используемое для доступа к приложению. Зачастую, если вы пытаетесь диагностировать проблему со своим приложением, можно сразу игнорировать большую часть клиентского кода и компонентов, таких как HTML, каскадные таблицы стилей (CSS), клиентский код JavaScript и т.п. Это также применимо не только к сайтам. Многие приложения для смартфонов, которые имеют современный пользовательский интерфейс, представляют собой веб-приложения.

С другой стороны, ошибка 400 Bad Request означает, что запрос, присланный клиентом, был неверным по той или иной причине. Пользовательский клиент может попытаться загрузить слишком большой файл, запрос может быть неверно сформирован, заголовки HTTP запроса могут быть неверными и так далее.

Мы рассмотрим некоторые из этих сценариев (и потенциальные решения) ниже. Но имейте в виду: мы не можем однозначно исключить ни клиент, ни сервер в качестве источника проблемы. В этих случаях сервер является сетевым объектом, генерирующим ошибку 400 Bad Request и возвращающим её как код ответа HTTP клиенту, но возможно именно клиент ответственен за возникновение проблемы.

Важно сделать полный бэкап вашего приложения, базы данных и т.п. прежде, чем вносить какие-либо правки или изменения в систему. Ещё лучше, если есть возможность создать полную копию приложения на дополнительном промежуточном сервере, который недоступен публично.

Подобный подход обеспечит чистую тестовую площадку, на которой можно отрабатывать все возможные сценарии и потенциальные изменения, чтобы исправить или иную проблему без угрозы безопасности или целостности вашего «живого» приложения.

Ошибка 400 Bad Request означает, что сервер (удалённый компьютер) не может обработать запрос, отправленный клиентом (браузером), вследствие проблемы, которая трактуется сервером как проблема на стороне клиента.

Существует множество сценариев, в которых ошибка 400 Bad Request может появляться в приложении. Ниже представлены некоторые наиболее вероятные случаи:

  • Клиент случайно (или намеренно) отправляет информацию, перехватываемую маршрутизатором ложных запросов. Некоторые веб-приложения ищут особые заголовки HTTP, чтобы обрабатывать запросы и удостовериться в том, что клиент не предпринимает ничего зловредного. Если ожидаемый заголовок HTTP не найден или неверен, то ошибка 400 Bad Request – возможный результат.
  • Клиент может загружать слишком большой файл. Большинство серверов или приложений имеют лимит на размер загружаемого файла, Это предотвращает засорение канала и других ресурсов сервера. Во многих случаях сервер выдаст ошибку 400 Bad Request, когда файл слишком большой и поэтому запрос не может быть выполнен.
  • Клиент запрашивает неверный URL. Если клиент посылает запрос к неверному URL (неверно составленному), это может привести к возникновению ошибки 400 Bad Request.
  • Клиент использует недействительные или устаревшие куки. Это возможно, так как локальные куки в браузере являются идентификатором сессии. Если токен конкретной сессии совпадает с токеном запроса от другого клиента, то сервер/приложение может интерпретировать это как злонамеренный акт и выдать код ошибки 400 Bad Request.

Устранение ошибки 400 Bad Request (попробуйте позже) лучше начать с исправления на стороне клиента. Вот несколько советов, что следует попробовать в браузере или на устройстве, которые выдают ошибку.

Наиболее частой причиной ошибки 400 Bad Request является банальный ввод некорректного URL. Доменные имена (например, internet-technologies.ru) нечувствительны к регистру, поэтому ссылка, написанная в смешанном регистре, такая как interNET-technologies.RU работает так же, как и нормальная версия в нижнем регистре internet-technologies.ru. Но части URL, которые расположены после доменного имени, чувствительными к регистру. Кроме случаев, когда приложение/сервер специально осуществляет предварительную обработку всех URL и переводит их в нижний регистр перед исполнением запроса.

Важно проверять URL на неподходящие специальные символы, которых в нем не должно быть. Если сервер получает некорректный URL, он выдаст ответ в виде ошибки 400 Bad Request.

Одной из потенциальных причин возникновения ошибки 400 Bad Request являются некорректные или дублирующие локальные куки. Файлы куки в HTTP – это небольшие фрагменты данных, хранящиеся на локальном устройстве, которые используются сайтами и веб-приложениями для «запоминания» конкретного браузера или устройства. Большинство современных веб-приложений использует куки для хранения данных, специфичных для браузера или пользователя, идентифицируя клиента и позволяя делать следующие визиты быстрее и проще.

Но куки, хранящие информацию сессии о вашем аккаунте или устройстве, могут конфликтовать с другим токеном сессии от другого пользователя, выдавая кому-то из вас (или вам обоим) ошибку 400 Bad Request.

В большинстве случаев достаточно рассматривать только ваше приложение в отношении файлов куки, которые относятся к сайту или веб-приложению, выдающему ошибку 400 Bad Request.

Куки хранятся по принципу доменного имени веб-приложения, поэтому можно удалить только те куки, которые соответствуют домену сайта, сохранив остальные куки не тронутыми. Но если вы не знакомы с ручным удалением определённых файлов куки, гораздо проще и безопаснее очистить сразу все файлы куки.

Это можно сделать разными способами в зависимости от браузера, который вы используете:

  • Google Chrome;
  • Internet Explorer;
  • Microsoft Edge;
  • Mozilla Firefox;
  • Safari.

Если вы получаете ошибку 400 Bad Request при загрузке какого-либо файла, попробуйте корректность работы на меньшем по размеру файле, Это включает в себя и «загрузки» файлов, которые не загружаются с вашего локального компьютера. Даже файлы, отправленные с других компьютеров, считаются «загрузками» с точки зрения веб-сервера, на котором работает ваше приложение.

Попробуйте выйти из системы и войти обратно. Если вы недавно очистили файлы куки в браузере, это приводит к автоматическому выходу из системы при следующей загрузке страницы. Попробуйте просто войти обратно, чтобы посмотреть, заработала ли система корректно.

Также приложение может столкнуться с проблемой, связанной с вашей предыдущей сессией, являющейся лишь строкой, которую сервер посылает клиенту, чтобы идентифицировать клиента при будущих запросах. Как и в случае с другими данными, токен сессии (или строка сессии) хранится локально на вашем устройстве в файлах куки и передаётся клиентом на сервер при каждом запросе. Если сервер решает, что токен сессии некорректен или скомпрометирован, вы можете получить ошибку 400 Bad Request.

В большинстве веб-приложений выход повторный вход приводит к перегенерации локального токена сессии.

Если вы используете на сервере распространённые пакеты программ, которые выдают ошибку 400 Bad Request, изучите стабильность и функциональность этих платформ. Наиболее распространённые системы управления контентом, такие как WordPress, Joomla! и Drupal, хорошо протестированы в своих базовых версиях. Но как только вы начинаете изменять используемые ими расширения PHP, очень легко спровоцировать непредвиденные проблемы, которые выльются в ошибку 400 Bad Request.

Если вы обновили систему управления контентом непосредственно перед появлением ошибки 400 Bad Request, рассмотрите возможность отката к предыдущей версии, которая была установлена, как самый быстрый и простой способ убрать ошибку 400 bad request.

Аналогично, любые расширения или модули, которые были обновлены, могут вызывать ошибки на стороне сервера, поэтому откат к предыдущим версиям этих расширений также может помочь.

Но в некоторых случаях CMS не предоставляют возможности отката к предыдущим версиям. Так обычно происходит с популярными платформами, поэтому не бойтесь, если вы не можете найти простой способ вернуться к использованию старой версии той или иной программной платформы.

В зависимости от конкретной CMS, которую использует приложение, имена этих компонентов будут различаться. Но во всех системах они служат одной и той же цели: улучшение возможностей платформы относительно её стандартной функциональности.

При этом имейте в виду, что расширения могут так или иначе получать полный контроль над системой, вносить изменения в код PHP, HTML, CSS, JavaScript или базу данных. Поэтому мудрым решением может быть удаление любых новых расширений, которые были недавно добавлены.

Даже если удалили расширение через панель управления CMS, это не гарантирует, что внесенные им изменения были полностью отменены. Это касается многих расширений WordPress, которым предоставляется полный доступ к базе данных.

Расширение может изменить записи в базе данных, которые «не принадлежат» ему, а созданы и управляются другими расширениями (или даже самой CMS). В подобных случаях модуль может не знать, как откатить назад изменения, внесенные в записи базы данных.

Я лично сталкивался с такими случаями несколько раз. Поэтому лучшим путём будет открыть базу данных и вручную просмотреть таблицы и записи, которые могли быть изменены расширением.

Если вы уверены, что ошибка 400 Bad Request не связана с CMS, вот некоторые дополнительные советы, которые могут помочь найти проблему на стороне сервера.

Ошибка, которую вы получаете от приложения, является результатом недостающих или некорректных специальных заголовков HTTP, которые ожидает получить приложение или сервер. В подобных случаях нужно проанализировать заголовки HTTP, которые отправляются на сторону сервера.

Почти любое веб-приложение будет вести логи на стороне сервера. Они представляют собой историю того, что делало приложение. Например, какие страницы были запрошены, к каким серверам оно обращалось, какие результаты предоставлялись из базы данных и т.п.

Логи сервера относятся к оборудованию, на котором выполняется приложение, и зачастую представляют собой детали о статусе подключённых сервисов или даже о самом сервере. Поищите в интернете “логи [ИМЯ_ПЛАТФОРМЫ]”, если вы используете CMS, или “логи [ЯЗЫК_ПРОГРАММИРОВАНИЯ]” и “логи [ОПЕРАЦИОННАЯ_СИСТЕМА]”, если у вас собственное приложение, чтобы получить подробную информацию по поиску логов.

Если это не помогло, проблема может быть в исходном коде, который выполняется внутри приложения. Попытайтесь диагностировать, откуда может исходить проблема, отлаживая приложение вручную и параллельно просматривая логи приложения и сервера.

Создайте копию всего приложения на локальном устройстве для разработки и пошагово повторите тот сценарий, который приводил к возникновению ошибки 400 Bad Request. А затем просмотрите код приложения в тот момент, когда что-то пойдёт не так.

Независимо от причины возникновения ошибки, даже если вам удалось исправить её в этот раз, появление в вашем приложении такой проблемы — это сигнал для того, чтобы внедрить инструмент обработки ошибок, который поможет автоматически обнаруживать их и оповещать в момент возникновения.

В этой статье мы расскажем об ошибке 400 bad request: что означает, почему возникает и как исправить.

Ошибка 400: что значит
Ошибка 400: причины появления
Как исправить ошибку HTTP 400 bad request

  • Очистите кеш и куки
  • Очистите кеш DNS
    • Windows
    • Linux
    • MacOS
  • Измените настройки антивируса и брандмауэра
  • Проверьте устройство на вирусы
  • Уменьшите размер файла
  • Проблема на стороне интернет-провайдера
  • Информация для владельца сайта

Ошибка 400: что значит

Все ошибки с кодом 4** означают, что проблема возникла на стороне пользователя.

Ошибка bad request 400 возникает тогда, когда браузер отправляет некорректный запрос серверу, на котором расположен сайт.

Как правило, проблема действительно возникает на стороне пользователя. Но бывают случаи, когда проблема обнаруживается на стороне владельца сайта или провайдера.

Ошибка 400: причины появления

Наиболее распространенными причинами возникновения error 400 являются:

  • устаревшие файлы куки и кеш браузера,
  • вирус на устройстве, который блокирует доступ к сайту,
  • загрузка пользователем на сайт слишком большого файла,
  • блокировка сайта антивирусом или брандмауэром,
  • некорректная ссылка на страницу,
  • проблемы на стороне интернет-провайдера.

Как исправить ошибку HTTP 400 bad request

Прежде всего проверьте, корректно ли указан URL-адрес. Ссылка на сайте могла быть указана с опечаткой или же вы могли случайно ошибиться при вводе URL. Попробуйте найти нужную страницу в браузере по ключевым словам. Когда вы найдете правильную ссылку, сайт заработает.

Если проблема не в этом, перейдите к настройкам, описанным ниже.

Очистите кеш и куки

Кеш и cookies созданы для того, чтобы запоминать файлы сайта и персональные данные пользователей. За счет хранения в памяти этих данных ускоряется повторная загрузка страницы сайта. Но при этом кеш и куки, которые хранят данные прошлой сессии, могут конфликтовать с токеном текущей сессии. Это вызовет код ошибки 400.

Очистите кеш и cookies по инструкции и попробуйте открыть страницу заново.

Очистить кеш и куки можно также при помощи программ CCleaner и Advanced SystemCare.

CCleaner позволяет в несколько кликов очистить кеш и cookies сразу в нескольких браузерах. Кроме того, с его помощью можно почистить все временные файлы на устройстве — они могут замедлять работу системы. Интерфейс программы интуитивно понятен и не требует технических знаний.
Advanced SystemCare — еще одна популярная программа для оптимизации работы устройства. С помощью нее можно удалять ненужные файлы, освободить память и место на жестком диске и ускорить работу системы. Также приложение может контролировать безопасность просмотра сайтов, защитить конфиденциальные данные, блокировать вредоносные веб-страницы и предотвращать майнинг криптовалюты.

Очистите кеш DNS

DNS-кеш хранит IP-адреса ранее посещенных сайтов локально на устройстве, чтобы ускорить связь с сервером и открывать веб-страницы быстрее.

Может случиться такое, что кеш DNS будет отправлять вас по старому IP-адресу. Обычно эта проблема приводит к ошибке 502, но может возникнуть и 400 ошибка сервера. Для исправления проблемы нужно почистить DNS-кеш. После этого браузер будет обращаться к новому IP-адресу и ошибка пропадет.  

Способ чистки DNS-кеша зависит от вашей операционной системы. Ниже мы описали, как очистить DNS-кеш на Windows, Linux и MacOS.

Windows

  1. Откройте командную строку. Для этого нажмите Win+R, введите «cmd» и нажмите OK:

  1. Введите команду: 

ipconfig /flushdns

  1. Дождитесь оповещения об успешной очистке кеша:

Linux

  1. Откройте терминал при помощи сочетания клавиш Ctrl+Alt+T.
  2. Введите команду:
  • Для Ubuntu:

sudo service network-manager restart

  • Для других дистрибутивов:

sudo /etc/init.d/nscd restart
 

MacOS

  1. Откройте терминал. Для этого нажмите Command+Space, введите «Терминал» и кликните по найденному приложению.
  2. Введите команду:

sudo killall -HUP mDNSResponder

Измените настройки антивируса и брандмауэра

Помешать соединению с сервером может антивирус или брандмауэр. Попробуйте временно отключить брандмауэр или антивирус. Если после этого сайт заработает, то необходимо изменить настройки брандмауэра/антивируса.

Как отключить брандмауэр на Windows 7/10/11

Брандмауэр — это межсетевой экран, защищающий ваш компьютер от мошеннических атак и утечек информации. У многих антивирусов есть встроенный межсетевой экран. Если у вашего антивируса он есть, то вы можете отключить брандмауэр для предотвращения ошибок. Если у вашего антивируса нет межсетевого экрана, отключать брандмауэр не рекомендуется.

Для отключения брандмауэра на Windows 7/10/11:

  1. Внизу экрана нажмите на значок лупы.
  2. Введите в поисковой строке «Панель управления» и выберите соответствующее приложение:

  1. Кликните на «Брандмауэр Защитника Windows»:

  1. Слева нажмите на «Включение и отключение брандмауэра Защитника Windows»:

  1. В блоках «Параметры для частной сети» и «Параметры для общественной сети» выберите пункт «Отключить брандмауэр Защитника Windows». Нажмите «OK»:

Готово, брандмауэр отключен.

Проверьте устройство на вирусы

Вирусы на телефоне или ПК могут быть причиной возникновения ошибки 400. Просканируйте ваше устройство антивирусом. Если обнаружится вирус, удалите его и перезагрузите устройство. Если вирусов нет, воспользуйтесь другими способами.
Обновите драйверы сетевых устройств
Устаревшие драйверы сетевых устройств могут генерировать некорректные запросы. Обновите драйверы и проверьте, наблюдается ли ошибка. Если проблема не исчезла, попробуйте другой способ.

Уменьшите размер файла

400 ошибка сервера может возникнуть в том случае, если пользователь загружает на сайт слишком большой файл. Иногда разработчики ограничивают максимальный размер файла, который может загрузить пользователь. Это делается для того, чтоб сэкономить место на сервере. Если при загрузке файла у вас возникала 400 ошибка, вероятно, файл превышает максимально допустимый размер. Попробуйте уменьшить файл и загрузите его повторно.

Проблема на стороне интернет-провайдера

Попробуйте открыть другой сайт. Если проблема сохраняется, вероятно, это ошибка сети. Для устранения проблемы попробуйте перезагрузить сетевое оборудование (роутер, модем) и ваше устройство.

Если перезагрузка не помогает, обратитесь к вашему интернет-провайдеру. Опишите проблему и какие действия вы предпринимали для ее устранения. Сообщите, какую операционную систему и браузер вы используете, пользуетесь ли вы брандмауэром и антивирусом, чистили ли вы кеш и куки.

Информация для владельца сайта

Что делать, если вы владелец ресурса и на вашем сайте возникла ошибка 400? Прежде всего, проделайте все вышеперечисленные шаги. Возможно, на стороне ваших клиентов сайт работает корректно. Очень редко, но все же бывает, что ошибка связана с проблемами на сервере. В таком случае необходимо обратиться в поддержку хостинг-провайдера, чтобы устранить ошибку.
 

Jan 12, 2023

Leonardus N.

9min Read

How to Fix a 400 Bad Request Error: 8 Easy Methods

The 400 bad request error is an HTTP status code that describes an error caused by an invalid request. Thus, the server can’t understand and process it. Most HTTP error 400 bad requests are caused by malformed request syntax, invalid request message framing, or deceptive request routing.

If you’re browsing the internet and encounter this error, it’s possible to solve the problem easily. However, there are several occasions when the error comes from the website server. In this case, only the site owner can fix the problem.

This article will discuss eight methods of resolving a 400 bad request error. We will also cover the HTTP error 400 bad request message variations and their possible causes.

Error code 400 Bad Request Error
Error type Client-side
Error variations HTTP Error 400
HTTP Error 400 – Bad Request
HTTP Error 400. The request hostname is invalid
HTTP Status 400 – Bad Request
400 Bad Request
400 – Bad Request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications.
400 Bad Request. Request Header Or Cookie Too Large
Bad Request – Invalid URL
Bad Request – Error 400
Bad Request – Your browser sent a request that this server could not understand
Error causes Bad URL syntax
File too big
Bad cookies or cache
DNS issues

Variations of the 400 Bad Request Error

As an HTTP status code, the 400 bad request error informs users why they can’t access a web page. That said, the error message may vary or not show the error code itself.

Here are some variations of the 400 bad request error message you may encounter:

  • HTTP Error 400
  • HTTP Error 400 – Bad Request
  • HTTP Error 400. The request hostname is invalid
  • 400 Bad Request
  • 400 – Bad Request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications.
  • 400 Bad Request – Request Header Or Cookie Too Large
  • Bad Request – Invalid URL
  • Bad Request – Error 400
  • Bad Request – Your browser sent a request that this server could not understand

“400 Bad Request Error” on Different Browsers

Just like a 404 error page, the 400 bad request page is customizable. For example, Google has a custom 400 bad request error page that looks the same on all web browsers.

Google 400 error page.

However, if the site doesn’t have a customized error page, the web browser will show the default one. Here is how the HTTP 400 bad request status code looks on different browsers:

Google Chrome

For 400 bad request, Chrome will show an error icon with The page isn’t working text followed by If the problem continues, contact the site owner. Then, you’ll find the HTTP ERROR 400 at the bottom of the message.

HTTP error 400 page on Google Chrome

Microsoft Edge

Microsoft Edge has a design almost identical to Google Chrome’s, with the HTTP ERROR 400 text at the bottom.

HTTP error 400 page on Microsoft Edge

Opera

The HTTP 400 bad request error in Opera displays the same text as Google Chrome. The only difference is the icon, as Opera uses its logo.

HTTP error 400 page on Opera

Mozilla Firefox

Mozilla Firefox will show a blank page when you try to access a website using the wrong syntax. There’s no text indicating that you encountered an HTTP 400 bad request error, which makes identifying the problem harder.

HTTP error 400 page on Mozilla Firefox

Safari

Like Mozilla Firefox, the browser will appear blank with no indication of the HTTP 400 bad request error.

HTTP error 400 page on Safari

Causes of the 400 Bad Request Error

When you try to access a website, your computer sends a request to the web server. Then, the server processes the request and sends back the page you want.

The error 400 bad request happens when the server can’t understand the request. Thus, it won’t process it and will send you the error code instead.

In most cases, client-side issues trigger the error. Some common causes of the 400 bad request error are:

  • Malformed URL syntax – the URL may contain invalid characters such as {, }, [, or ]. A wrongly encoded URL can also contain wrongly used ASCII characters, such as double percentage characters.
  • Large file size – websites have a file upload limit. An attempt to upload a file that exceeds this limit can be considered a bad request and trigger the HTTP 400 error status code.
  • Corrupted browser cookies or cache – expired cookies or corrupted browser cache may interfere with the request and trigger the error. This commonly happens on login pages such as the WordPress login page.
  • Bad DNS cache – if the website has moved to a new domain name or web host, the DNS cache data in your operating system may be invalid.

How to Fix a 400 Bad Request Error

The first action we recommend is refreshing the page. If that doesn’t work, then you should try the following methods.

1. Double Check the Domain Address

One of the most common causes of HTTP status 400 bad request error is a wrong URL. This may include a mistyped URL, malformed syntax, and illegal characters in the URL.

It’s easy to mistype a URL, so be sure to check the domain name spelling. If the URL contains a directory path, file name, or query string, pay attention to special symbols such as a hyphen (-) or percentage character (%).

For example, www.hostinger.com/tutorials is the correct domain name. If you type in www.hostinger.com/%tutorials in the URL bar with an extra percentage character, it will result in a 400 bad request error.

Screenshot of HTTP 400 error page

A badly encoded URL can also cause this error. URL encoding converts characters into ASCII characters to make them transferable on the internet. For example, one of the most common encodings is replacing space with %20.

However, a URL can be encoded incorrectly and thus contain incorrect syntax, like double percentage characters (%%). If you enter a URL or click on a link that’s badly encoded, you’ll end up with a bad request error 400.

When encountering a 400 bad request error because of a wrong URL, use an encoder/decoder tool. Decode the URL and encode it again to make sure it is correct.

2. Search the Keyword

There may be cases where you are sure that the URL is correct, yet the error persists. If you know the title of the article or page you’re looking for, search the keywords on the website or a search engine. Sometimes you can even see the title on the URL.

For example, in the /tutorials/how-to-make-a-website URL, you’ll see the article’s title at the end of the URL. If the website has a search feature, type the keyword to find the article.

Alternatively, use a search engine like Google or Bing. To perform a search on a specific site, type site: followed by the website’s URL and the keyword.

For example, the title of the article is how to make a website. Therefore, you type site:hostinger.com how to make a website.

Google search query using site

3. Clear Browser Cache or Cookies

Browser cookies and cache store site data and content on the client’s side to improve the browsing experience.

The browser cache contains website files such as texts and images to reduce requests to the web server and make the page load faster. At the same time, cookies store the user’s session history and preferences to make personalized browsing possible.

However, cookies may expire after some time. Also, both the website cookies and cache can be corrupted and cause a 400 bad request error.

Additionally, HTTP status 400 bad request error can happen when the web browser sends cookie data that’s too large. In this case, the error message appears as 400 Bad Request – Request Header Or Cookie Too Large.

Try clearing your browser cache and cookies to solve this problem. If you’re using Google Chrome, here are the steps to do it:

  1. Click on the three dots on the top right corner of Google Chrome and select Settings.

Selecting Settings on Google Chrome

  1. Find the Privacy and security section and click on Clear browsing data.

Clear browsing data on Google Chrome

  1. On the Clear browsing data window, check the Cached images and files and Cookies and other site data and use the drop-down menu to select the time frame.

Clear browsing data on Google Chrome.

  1. Click Clear data and restart Google Chrome to finish the process.

Remember that clearing the browser cache and cookies resets the settings and signs you out of websites you’ve visited. Also, it will take more time to load the websites since the browser will need to retrieve the content previously stored in the cache.

If the cache and cookies were causing the 400 bad request error, you should be able to visit the website normally again. However, if it doesn’t work, try the next method.

4. Turn Off Browser Extensions

Browser extensions can also cause a bad request error 400. That’s because these extensions interfere with the request sent to the web server, which may lead the web server to interpret the request as invalid.

Moreover, browser extensions may affect cookies, which leads to a 400 bad request error. To find out if a browser extension is causing the problem, we recommend disabling all extensions first. Here are the steps for Google Chrome:

  1. Click on the three dots on the top right corner of Google Chrome. Select More tools -> Extensions.

Selecting extensions on Google Chrome

  1. Turn off all extensions individually by clicking on the switch button.

Disabling a Google Chrome extension

  1. Refresh the web page. If it loads normally, one of the extensions is causing the 400 bad request error.

After establishing that one of the extensions triggered the error, you need to identify the exact extension. Turn on the extensions one by one, refreshing the web page each time.

If you encounter a 400 bad request error after turning on one of the extensions, you’ve found the one causing the error. Keep the extension disabled or remove it altogether by clicking the Remove button on the extension settings page.

5. Check the File Size

Trying to upload a file that exceeds the server file size limit might trigger an HTTP status 400 bad request error. Sites usually have a different file upload limit, so check if the file you want to upload fits the limit.

If the website doesn’t mention the file limit, upload a small file to check whether that’s causing the error. If it works, then you should resize the file you originally wanted to upload.

Keep in mind that file compression may negatively affect its quality. If it’s a PDF or image, it can make the content blurry and unreadable. Be sure to check the quality of the file after compression and make sure that it’s still acceptable.

There are many free online compression tools so that you don’t need to install additional software on your computer. Some of the great examples are HiPDF for PDF files and UniConverter for video and audio files.

Wondershare HiPDF PDF compressor

6. Flush DNS Cache

When you visit a site for the first time, the system goes through a DNS lookup, which searches for the nameservers and IP addresses that are associated with the domain name.

Your operating system then stores the IP addresses of the web servers in the DNS cache. Therefore, the system can reduce the DNS lookup process on the next visit, making the site load faster.

However, a corrupted or outdated DNS cache can trigger the HTTP error 400 bad request. In this case, you need to flush the DNS cache.

Since the DNS cache is stored in the operating system, the methods to flush it may vary. If you use Google Chrome, you’ll also have to flush the DNS cache in the web browser.

Here are the steps to do it on Windows and Mac OS:

Microsoft Windows 10

  1. Right-click on the Windows Start Menu and select Search or use the search box in the taskbar if enabled.

Search feature on Windows 10

  1. Type command prompt and select the Command Prompt application.

Searching Command Prompt on Windows 10

  1. Type ipconfig /flushdns and press Enter.

Flush DNS command on command prompt

  1. You’ll see the Successfully flushed the DNS Resolver Cache message after the process is completed.

Successful DNS flush on command prompt

macOS X

Press the F4 key to open Launchpad and enter Terminal to open the command terminal. Run the following command if you use macOS Sierra, X El Capitan, X Mavericks, X Mountain Lion, or X Lion:

sudo killall -HUP mDNSResponder.

Google Chrome

  1. Type chrome://net-internals/#dns on Google Chrome’s address bar and press Enter:
  2. Click Clear host cache.

Clear host cache on Google Chrome.

If you use a different operating system, make sure to check our comprehensive guide on how to flush DNS cache.

7. Contact the Site Owner to Report the Error

If all attempts to fix the 400 bad request error didn’t work, there’s a possibility that the problem isn’t a client error but rather is a misconfiguration that the web owner needs to fix.

In this case, try to visit the contact page of the website and fill a contact us form, if available. Otherwise, most sites also have contact email addresses and social network accounts where you can inform them about the 400 bad request error.

8. Restart Your PC and Other Hardware

The last method is to restart your computer and network connection hardware, such as router and modems.

Restarting a PC often solves various problems, including the 400 bad request error because it clears the Random Access Memory (RAM). Moreover, it flushes the temporary cache that’s created as you open and close programs.

Temporary data from background processes may interfere with the request sent to the server, causing the 400 bad request error.

Conclusion

The HTTP status 400 – bad request indicates that the request sent to the server is invalid or corrupted. Just like other 4xx status codes, a 400 bad request is a client-side issue.

It can be caused by malformed request syntax, invalid request message framing, or deceptive request routing.

Since this is a client-side problem, users can easily resolve most of the 400 bad request errors. To recap, here are eight methods to resolve the error:

  1. Double-check the domain address.
  2. Search the keyword.
  3. Clear browser cache and cookies.
  4. Turn off browser extensions.
  5. Check and reduce the file size.
  6. Flush the operating system’s DNS cache.
  7. Report the error to the site owner.
  8. Restart the PC and networking equipment such as the router and modem.

If you have other tips or solutions, feel free to leave us a comment below.

Author

Leo is a WordPress fanatic and contributor. He likes keeping up with the latest WordPress news and updates, and sharing his knowledge to help people build successful websites. When he’s not working, he contributes to WordPress documentation team and pampers his dogs.

We open many websites at one time on our browser to search for something on the internet. There are some websites that we check daily; it can be a news site, your work login, or something else. If such important websites show errors like ‘400 Bad Request, Request Header or Cookie Too Large,’ it can get frustrating.

At times, you will see the same error on all the different browsers available on your computer for a specific website only. Let’s get started on what this error is and how to eliminate it to enjoy browsing again.

The ‘request header too large’ error message can be seen on any website for two main reasons. One reason is that the size of the cookie for that particular domain is too large, and therefore the server refuses to display the website. Another reason for the ‘400 Bad Request, Request Header or Cookie Too Large’ error message is corrupted cookies.

Well, you can experience this error on Google Chrome, Microsoft Edge, Mozilla Firefox, or any other browser. This error happens mostly on the sites that are running on the Nginx server.

How To Fix Request Header Or Cookie Too Large Error

You can clear cookies and cache for that particular website to fix this 400 bad request error on your browser.

Note: The solutions are suggested with regard to different famous browsers. You can jump to the web browser section you are currently using and understand how to fix request header or cookie too large.

Google Chrome

There are two ways to reach the cookie settings. You can open the new tab in the browser and type –

chrome://settings/cookies 

If you don’t want to go the direct way, follow steps 1 to 3 below. You need to follow instructions from step 4, irrespective of what way you choose to reach the cookie settings page.  

Step 1: Open Google Chrome browser and click on the 3 dots in the upper right corner of the browser window. Select Settings from the menu.

Open Settings

Open Settings

Step 2: In the Settings tab, scroll down to Privacy and security and click on the arrow next to Site Settings.

Open Site Settings

Open Site Settings

Step 3: Now, click on Cookies and site data under the Content section.

Open Cookies and site data

Open Cookies and site data

Step 4: Click on the arrow next to See all cookies and site data on the next screen.

See all cookies and site data

See all cookies and site data

Step 5: You can either delete all the cookies by clicking on the Remove All option or delete the cookie of the affected website by clicking on the delete icon next to it.

If you don’t find the problematic web page easily, you can search for it in the search bar.

Delete cookies of the website giving error

Delete cookies

Once the cookies are deleted, you can relaunch the browser. In the browser, check if you can access the website giving ‘400 Bad Request, Request Header or Cookie Too Large’ errors or not.

Microsoft Edge

Microsoft Edge does not allow you to clear cookies for a single website. You need to clear cookies and site data for all the websites. There is a timestamp option available which allows you to remove browser cookies for a specific time frame.

Open the Microsoft Edge browser and click on the 3 dots in the top right corner of the browser. Click on the Settings from the menu.

In the Settings tab, click on Privacy, search, and services from the left tab.

Next, scroll down to the Clear browsing data section and click on the Choose what to clear button.

Click on Choose what to clear

Click on Choose what to clear

Select the Time range; if you wish to avoid deleting all cookies, select the Last hour option. Also, check the checkbox next to Cookies and other site data.

Click on the Clear now button.

Click on the Clear now button to fix request header or cookie too large

Click on the Clear now button

Close the Microsoft Edge browser and open it again. Once opened, try accessing the website that was giving an error. If corrupted cookies were a problem, you would be able to access the website again on the browser without a request header or cookie too large error message.

Mozilla Firefox

If you are Mozilla Firefox, you can get rid of cookies from a problematic website easily.

Step 1: Open the Mozilla Firefox browser on your computer and click on 3 lines in the upper right corner. Select Settings from the menu.

Step 2: From the Settings tab, click on Privacy & Security.

Open Privacy & Security

Open Privacy & Security

Step 3: Now, scroll down to Cookies and Site Data and click on the Manage Data option.

Open Manage Data

Open Manage Data

Step 4: In Manage Cookies and Site Data window, select the website that was giving 400 Bad Request, Request Header or Cookie Too Large error, and click on Remove Selected.

Remove cookies for affected website to fix request header or cookie too large

Remove cookies for affected website

Make sure you don’t click on Remove All; it will remove cookies and cache from all websites you have browsed.

Opera Browser

If you are a fan of Opera browser, you would like to know how to get rid of the Request Header or Cookie Too Large error in Opera.

Launch the Opera browser and Easy setup option (3 lines) in the top right corner. Click on Go to full browser settings seen at the end of the menu.

Next, expand the Advanced section and click on Privacy & security.

Open Privacy & security

Open Privacy & security

Now, open the Site Settings

Open the Site Settings

Open the Site Settings

In the Site Settings, click on the arrow next to the Cookies and site data under Content.

Open Cookies and site data in the Opera

Open Cookies and site data in the Opera

Scroll down and click on See all cookies and site data

See all cookies and site data in Opera browser

See all cookies and site data in Opera browser

Click on the delete icon next to the website that was showing the 400 Bad Request error. You can search for that website in the search box if you don’t find it easily.

Clear cookies in Opera to fix request header or cookie too large

Clear cookies in Opera

You can relaunch the browser and try opening the website again.

Internet Explorer

Although Internet Explorer is not used much nowadays, some people rely on it for work purposes. Know how to clear cookies and get rid of the 400 Bad Request, Request Header or Cookie Too Large error message.

Open Internet Explorer and click on the Settings gear in the top right corner of the browser. Select Internet options from the Settings menu.

Open Internet options

Open Internet options

In the Internet options dialog box, click on the General tab and then click on the Settings button under Browsing history.

Click on Settings

Click on Settings

Now, under the Temporary Internet Files tab, click on the View files button.

Click on View files to fix request header or cookie too large

Click on View files

The File Explorer window will open, and you will see files with the website name. You can delete the file that has the affected website name. Make sure you press the Shift + Delete keys to delete that file from your computer permanently.

Now, relaunch the Internet Explorer and browse the website that was giving errors before.

Use Third-party Application

Some people use multiple browsers to keep their work and entertainment tabs separated. Well, in such a case, deleting cookies from each of the browsers can be tedious work. You need to launch and relaunch all the browsers just to clear cookies for one particular website.

For such a user, we recommend using a third party tool called CookieSpy. It is a free tool that allows you to view and delete cookies from multiple browsers in one window. The currently supported browsers are Google Chrome, Mozilla Firefox, Apple Safari, Internet Explorer,  and Opera.

CookieSpy can be used only to view and delete cookies. It does not support any other feature than that. This makes it convenient for people who want an app just to clear cookies from different browsers.

When you install CookieSpy, it will detect all the browsers on your computer and have tabs for all the different browsers showing saved cookies. You can delete cookies for any site on any browser from the CookieSpy window.  

Download CookieSpy

Conclusion

The 400 error can be seen anywhere while you use the browser. It can get extremely annoying when you are not able to access important work-related websites. The website itself can resolve the 400 Bad Request, Request Header or Cookie Too Large error message in a few minutes if the error is from their end because of cookie size.

However, if the error is because of corrupt cookies in your browser, the only way to fix the 400 Bad Request error message is to clear cookies for that website. You can easily clear cookies from Google Chrome, Microsoft Edge, Mozilla Firefox, and Opera Browser. But when it comes to Internet Explorer, you need to delete it via File Explorer.

The process of clearing cookies for Internet Explorer via File Explorer is mentioned above, but we recommend switching from Internet Explorer to a different browser, as Microsoft is ending support for Internet Explorer from August 2021.

Возможно, вам также будет интересно:

  • Ошибка 4 приора на приборке что это
  • Ошибка 400 неверный запрос размер заголовка запроса или куки слишком велик нгинкс
  • Ошибка 4 на приоре что она означает
  • Ошибка 400 неверный запрос как исправить
  • Ошибка 400 на телевизоре самсунг

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии