Гугл ошибка 400 что это

Cправка — Gmail

Войти

Справка Google

  • Справочный центр
  • Сообщество
  • Gmail
  • Политика конфиденциальности
  • Условия предоставления услуг
  • Отправить отзыв

Тема отзыва

Информация в текущем разделе Справочного центра

Общие впечатления о Справочном центре Google

  • Справочный центр
  • Сообщество
  • Раньше не работали с интегрированным сервисом Gmail?

Gmail

Ошибка 400 Bad request (от англ. «Плохой запрос») — это ответ сервера, который возникает при отправке ему неправильного запроса. Категория 400 свидетельствует о том, что сбой находится на пользовательской стороне. Простыми словами, ошибка 400 — это сбой на стороне клиента (например, браузера), который не дает открыть страницу с контентом или затрудняет его просмотр.

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

Пример ошибки при открытии Twitter.com

Пример ошибки при открытии Twitter.com

Перед тем, как мы начнем, важно прояснить некоторые понятия:

  • Сервер — удаленный компьютер, на котором хранится сайт.
  • Клиент — программа, которая обращается к серверу через отправку запросов при помощи конкретного протокола, например, браузер.
  1. Пользователь допустил опечатку в URL. Ошибка в синтаксисе ссылки — наиболее частый сценарий ее появления.
  2. Блокировка домена или конкретной страницы сайтов. Заблокировать доступ может не только антивирусное ПО, но и брандмауэры, защитные экраны, расширения браузера и даже само оборудование сети, если оно было предварительно настроено соответствующим образом. Кроме того, причиной блокировки конкретного сайта могут служить настройки ОС.
  3. Некорректные или устаревшие драйверы сетевого оборудования. Такое программное обеспечение способно формировать неправильные запросы к серверу. В результате страница сайта отдает 400-ю ошибку. Драйверы для всех сетевых устройств должны быть актуальными и обновляться сразу, как появится такая возможность.
  4. Программные сбои, вывод из строя сетевого оборудования. Если перестали загружаться вообще все сайты, это может быть как раз такой случай.
  5. Неактуальные cookies. Использование браузером недействительных кук может трактоваться сервером как попытка фишинга, поэтому устаревшие cookies запрещены и доступ к сайту автоматически ограничивается.
  6. Посетитель пытается загрузить на сайт файл слишком большого размера. Известно о таком сценарии появления — например, на портале «Госуслуги» при попытке загрузить заявление или фотографию.
  7. Вебмастер сделал некорректный редирект на странице и теперь она не открывается у всех посетителей.
  8. Накопление некорректных данных в DNS-кэше Windows. В результате страница ранее посещенного сайта может отдавать некорректный код состояния HTTP.
  9. Вредоносный код в системе. Заражение может произойти при посещении сомнительных сайтов, использовании чужих флешек, установки взломанных программ.
  10. Сбой на стороне сервера. Один из редких сценариев, но иногда встречающийся.

Как исправить ошибку 400 пользователю

Теперь переходим к исправлению Bad request и для каждой указанной причины дадим решение.

Пользователь допустил опечатку в URL

Внимательно проверьте введенный адрес. Допустить опечатку при ручном вводе очень просто, так как URL содержит большое количество символов. Лучше копировать и вставлять ссылку автоматически, при помощи одновременного сочетания клавиш Control + C / Control + V.

Если вводите адрес вручную, внимательно проверяйте каждый символ внутри URL

Если вводите адрес вручную, внимательно проверяйте каждый символ внутри URL

Вредоносный код в системе

Проверьте систему надежным антивирусным ПО, например, продуктами «Лаборатории Касперского» или антивирусом Dr.Web. Если в системе найден вредоносный код, то его необходимо удалить как можно скорее.

Блокировка домена или конкретной страницы сайта

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

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

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

Добавляем браузер в список исключений антивируса

Добавляем браузер в список исключений антивируса

Некорректные, устаревшие драйверы сетевого оборудования

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

Скачиваем драйверы для Wi-FI роутера на сайте производителя устройства

Скачиваем драйверы для Wi-FI роутера на сайте производителя устройства

Программные сбои, вывод из строя сетевого оборудования

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

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

Неактуальные cookies

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

Очистите cookies и все временные файлы в используемом браузере. Например, в Google Chrome откройте настройки и выполните следующие действия:

  1. Откройте раздел «Конфиденциальность и безопасность».
  2. Кликните по строке «Файлы cookie и другие данные сайтов».
  3. Выберите пункт «Посмотреть все разрешения и данные сайтов».
  4. Кликните кнопку «Удалить все данные».
  5. Для подтверждения выбора нажмите «Удалить».

 Удаляем cookie в Google Chrome

Удаляем cookie в Google Chrome

Посетитель пытается загрузить на сайт файл слишком большого размера

Проверьте размер загружаемого файла: при необходимости уменьшите его, например, добавив файл в архив или задействовав компрессию изображения.

Обычно в окне загрузки файла находится примечание о его максимально допустимом размере:

Ограничение по размеру файла указаны в окне загрузки

Ограничение по размеру файла указаны в окне загрузки

Некорректный редирект

Необходимо проверить выполнение перенаправления при открытии проблемной страницы. Если оно выполняется, вы увидите изменение URL в адресной строке браузера.

Если Ошибка 400 возникает на вашем сайте — удалите некорректный редирект. Если на чужом — напишите администратору или в техподдержку: на крупных сайтах, как правило, это отдельный e-mail.

Пример предупреждения, которое рассылает хостинг в связи с недоступностью некоторых серверов

Пример предупреждения, которое рассылает хостинг в связи с недоступностью некоторых серверов

Накопление некорректных данных в DNS-кэше ОС

Рассмотрим на примере двух операционных систем.

На Windows

Выполните следующие действия:

  1. Нажмите кнопку «Пуск».
  2. В поисковой строке укажите cmd.
  3. Запустите командную строку от имени администратора.
  4. Введите команду ipconfig/flushdns.
  5. Подтвердите, нажав клавишу Enter.

Ввели команду ipconfig/flushdns в командной строке

Ввели команду ipconfig/flushdns в командной строке

Все, DNS кэш успешно очищен.

На macOS

Выполните следующие действия:

  1. Откройте «Терминал».
  2. Укажите sudo killall -HUP mDNSResponder; sleep 2;
  3. Введите админский пароль.

Мы успешно очистили кэш.

Открыть Terminal можно через поиск macOS

Открыть Terminal можно через поиск macOS

Сбой на стороне сервера

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

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

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

В 95 % случаях, как мы уже говорили выше, причина кроется на стороне клиента. Но если вам кажется, что это не так, попробуйте проверить три сценария:

  1. Глобальные изменения на сайте. Например, обновление версии CMS, установка новой темы, глобальное изменение вида ссылок. Все это способно привести к сбоям на сайте, включая невозможность открыть страницу.
  2. Плагины. Вспомните, какие именно плагины или расширения вы устанавливали на сайт в последнюю неделю. Важно идентифицировать такие плагины, чтобы отключить их в дальнейшем.
  3. Плагины могут прописывать свой код в базы данных сайта. В некоторых случаях такие операции могут вывести сайт из строя (упрощенно говоря). Вот почему важно делать регулярные бекапы, особенно если вы планируете установку плагинов или внедрение глобальных изменений на сайте. Важно бекапить не только файлы сайта, но и его БД.

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

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

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

Откройте проблемную страницу и запустите программу-отладчик (она еще называется debug) прямо в браузере. Для этого нажмите клавишу F12. В консоли разработчика перейдите на вкладку «Sources» и выполните следующие действия:

  1. Откройте навигатор. Для этого кликните по иконке:
  2. Кликните по этому значку

    Кликните по этому значку
  3. Найдите необходимый файл: например, hello.js (2).
  4. В крайнем правом окне вы увидите панель отладки JavaScript (3).
  5. Еще раз убедитесь, что выбран корректный файл (1).
  6. breakpoint

  7. Кликайте по номерам строк, чтобы задать точку остановки (breakpoint):
  8. В разработке ПО и отладке точка останова — это преднамеренная пауза в программе, созданная для целей отладки. Его также иногда называют просто паузой.

  9. Внимательно анализируйте каждую строчку, чтобы обнаружить сбой.
  10. Ставим breakpoints и проверяем одноименный список справа

    Ставим breakpoints и проверяем одноименный список справа

Бонус: как очистить систему от мусора для профилактики появления Bad Request

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

Шаг 1. Запустите программу, нажмите кнопку «Реестр», отметьте все чекбоксы и нажмите кнопку «Поиск проблем»:

Очищаем реестр утилитой CCleaner

Утилита найдет ошибки в реестре.

Шаг 2. Нажмите кнопку «Посмотреть выбранные проблемы». Программа предложит создать резервную копию реестра перед внесением изменений. На всякий случай нажимаем «Да». Теперь нажимаем кнопку «Исправить отмеченные».

Всё — ошибки реестра успешно локализованы!

Последовательность действий при очистке реестра в CCleaner

Последовательность действий при очистке реестра в CCleaner

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

Очищаем мусор в системе, благодаря CCleaner

Очищаем мусор в системе, благодаря CCleaner

На вкладке «Приложения» вы можете выбрать конкретные программы, которые нужно очистить от мусора.

Таким образом, мы проверили каждую причину 400 ошибки + очистили систему от мусора, чтобы предотвратить появления иных проблем в ОС.

Раздражает, когда какой-то сайт не загружается и отзывается непонятными ошибками. Обычно они сопровождаются одним из десятков HTTP-кодов, которые как раз намекают на характер сбоя, а также его вероятные причины. 

В этом материале поговорим об ошибке 400 Bad Request. Почему она появляется и как ее исправить. 

Чуть подробнее об ошибке 400

Как и другие коды, начинающиеся на четверку, 400 Bad Request говорит о том, что возникла проблема на стороне пользователя. Зачастую сервер отправляет ее, когда появившаяся неисправность не подходит больше ни под одну категорию ошибок. 

Стоит запомнить — код 400 напрямую связан с клиентом (браузером, к примеру) и намекает на то, что отправленный запрос со стороны пользователя приводит к сбою еще до того, как его обработает сервер (вернее, так считает сам сервер). 

Комьюнити теперь в Телеграм

Подпишитесь и будьте в курсе последних IT-новостей

Подписаться

Из-за чего всплывает Bad Request?

Есть 4 повода для возникновения ошибки сервера 400 Bad Request при попытке зайти на сайт:

  1. Некорректно настроенные HTTP-заголовки в запросе со стороны клиента. Некоторые приложения и сайты мониторят заголовки на предмет наличия в них чего-нибудь подозрительного. Если ваш запрос не соответствует ожиданиям сервера, то высока вероятность появления ошибки 400 (но это не всегда вина пользователя).
  2. Такой же сбой появляется, если клиент пытается загрузить на сервер файл слишком большого размера. Это происходит, потому что на большинстве сайтов есть ограничения по размеру загружаемых данных. Причем ограничение может быть как в 2 гигабайта, так и в 600 килобайт.
  3. Еще ошибка 400 появляется, когда пользователь пытается получить доступ к несуществующей странице. То есть в браузер банально ввели ссылку с опечаткой, некорректным доменом или поддоменом.
  4. Устаревшие или измененные куки-файлы. Сервер может воспринять подмену куки-файлов как попытку атаковать или воспользоваться дырой в безопасности. Поэтому такие запросы сходу блокируются.

Читайте также

Ошибка сервера 401

Ошибка 502 Bad Gateway Error

Исправляем ошибку 400 Bad Request на стороне клиента

Так как ошибка 400 в 99 случаев из 100 возникает на стороне клиента, начнем с соответствующих методов. Проверим все элементы, участвующие в передаче запроса со стороны клиента (браузера).

Проверяем адрес сайта

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

А еще стоит поискать запрашиваемую страницу через поисковик, встроенный в сайт. Есть вероятность, что конкретная страница куда-то переехала, но сервер не может показать подходящий HTTP-код в духе 404 Not Found. Если, конечно, сам сайт работает. 

Сбрасываем параметры браузера

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

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

В зависимости от браузера процесс удаления куки-файлов может немного отличаться. В Chrome это работает так:

  • Открываем настройки браузера. 
  • Переходим в раздел «Конфиденциальность и безопасность».
  • Выбираем «Файлы cookie и другие данные».
  • Нажимаем на кнопку «Удалить все».Удаление кукис в Google Chrome

Для чистки cookies можно использовать стороннюю программу в духе CCleaner или CleanMyPC.

Загружаем файл подходящего размера

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

Устраняем проблемы, связанные с Windows и сторонним софтом

Помимо браузера, на работу сети могут влиять другие программные продукты (экраны, защищающие от «непонятных подключений»). И вирусы. Да и сама Windows может стать проблемой. Почти любой ее компонент. Поэтому надо бы проделать следующее:

  • Повторно установить NET.Framework. Желательно перед этим удалить предыдущую версию.
  • Установить какой-нибудь приличный антивирус (а лучше два) и запустить глубокую проверку систему. Возможно, подключению и входу на ресурс мешает вредоносная программа.
  • Если у вас уже установлен антивирус, то, наоборот, попробуйте его отключить. Иногда встроенные в них экраны проверки подключений блокируют работу браузера целиком или отдельных страниц. Лучше выдать браузеру больше прав на выполнение своих задач или установить антивирус, который более лояльно относится к установленному на компьютере софту.
  • Еще надо поменять параметры брандмауэра. Его можно разыскать в панели управления Windows. Там надо добавить в список исключений ваш браузер. Тогда брандмауэр не будет мешать подключению к запрашиваемому сайту.
  • Почистить Windows от программного мусора. Можно пройтись приложением CCleaner. 
  • Обновить драйверы для сетевых устройств. 
  • Обновить Windows или просканировать систему на наличие погрешностей в системных компонентах.

Ищем проблему на стороне сервера

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

Проверяем требования к HTTP-заголовкам

Пока настраиваешь сайт, несложно допустить ошибку или даже парочку. Возможно, требования к HTTP-заголовком указаны некорректно, и сервер ожидает запросы с ошибками, которые по объективным причинам не может распознать адекватно. Тогда администратору стоит перепроверить ожидаемые заголовки на своем сайте или в приложении. 

Удаляем свежие обновления и плагины

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

Главное, перед этим сделать резервную копию данных. И перед установкой обновлений тоже стоило бы.

Проверяем состояние базы данных

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

Исправляем ошибки в коде и скриптах

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

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

На этом все. Основные причины появления 400 Bad Request разобрали. Как ее лечить — тоже. Теперь дело за вами. Пользуйтесь полученной информацией, чтобы больше не пришлось мучиться в попытках зайти на нужный ресурс.

What is a ‘400 Bad Request’ Error?

The “400 Bad Request” meaning is that the server could not understand or be unable to process a client’s request due to malformed or incorrect formatting.

When a server encounters this error, it means that the request sent by the client cannot be understood and the server cannot determine its status code category. This error arises from issues such as syntax errors, invalid data, or missing parameters.



What does 400 Bad Request Error look like on different Browsers?

You must have seen 400 Bad Request Errors many times on your Chrome browser, and it is a fact that, just like the 404 Not Found error, the 400 Bad Request error can also be customizable and may appear differently on different browsers.

If the website doesn’t have a custom error page, the browser will display the default error page. Let’s take a look at how it appears on different browsers.

400 Bad request Chrome

In Google Chrome, the 400 error will be displayed with a message, i.e., “This page isn’t working.”

400 Bad request Chrome

400 Bad request Chrome

But when you see it on other browsers such as Firefox and Safari, the error will be displayed as a completely white tab without any error message.

400 Bad request Firefox

400 Bad request Firefox

400 Bad request Firefox

400 Bad request Safari

400 Bad request Safari

400 Bad request Safari

400 Bad request Microsoft Edge

In Microsoft Edge, the 400 Bad Request error will be displayed as “This page isn’t working at the moment.”

400 Bad request Microsoft Edge

400 Bad request Microsoft Edge

Why does 400 error occur?

There can be various reasons that cause 400 Bad request errors and even this error is not limited to only certain Browsers or Operating systems. Therefore, the troubleshooting method can be varied.

  • Incorrect URLs
  • Invalid or missing request headers
  • Corrupt Browser Cache and Cookies
  • DNS Lookup Cache
  • Large request size exceeding server limits
  • Invalid or unsupported HTTP methods
  • Server glitch

1. Incomplete URLs

If the URL structure is not valid, something is missing or poorly constructed, it can trigger a “400 Bad request error”. This can happen due to a variety of reasons such as Typo error, using invalid characters, malformed syntax, or missing parameters, which can render the URL invalid, causing the server to reject the request.

Request headers provide additional information about the client’s request. If the headers are invalid or missing, the server may not be able to process the request correctly, resulting in a “400 Bad Request” error.

3. Corrupt Browser Cache and Cookies

Even though the URL is correct, the 400 Bad Request error can be triggered due to corrupt files stored in the browser cache or issues caused by outdated cookies.

4. DNS lookup Cache

The 400 Bad Request error can also happen if the DNS cache gets corrupted. It refers to a situation where the information stored in the DNS cache becomes inaccurate, outdated, or inconsistent.

The DNS cache is responsible for storing previously resolved domain name-to-IP address mappings, allowing for faster and more efficient browsing by eliminating the need to query DNS servers repeatedly for the same information.

5. Large request size exceeding server limits

Servers often impose limitations on the size of files you can upload to prevent excessive resource consumption. When you attempt to upload a file to a website that exceeds the specified limit, the server cannot fulfill the upload request and rejects it, triggering a 404 Bad Request Error.


Read: 🚩 How to fix the “The uploaded file exceeds the upload_max_filesize directive in php.ini” Error?


6. Invalid or unsupported HTTP methods

HTTP methods, such as GET, POST, or PUT, determine the type of request being made. If an unsupported or incorrectly specified HTTP method is used, the server cannot understand the request and responds with a “400 Bad Request” error.

7. Server Glitch

While the 400 Bad Request error is typically associated with client-side errors, it can also be triggered by server-side issues. This error indicates a general problem with the server, which could be caused by temporary server-related issues or minor glitches.

If this is the case, and you are trying to visit a third-party website experiencing the 400 Bad Request error due to server-side issues, you have limited control over the situation. The only options available to you are to refresh the website or periodically check its status to see if the web administrator has resolved the issue.


Now that you are aware of the most common causes behind 400 Bad Request errors, you might be wondering, “How can I fix a 400 Bad Request error?” or “What steps should I take to resolve it?”

Fortunately, the answer is straightforward and not as challenging as it may appear. Simply follow the steps outlined in this section to diagnose and resolve a 400 Bad Request error. The suggested solutions include the following:

Troubleshooting and Resolving “400 Bad Request” Errors: If you encounter a “400 Bad Request” error, follow these steps to troubleshoot and resolve the issue:

  • Verify the URL
  • Clear Browser cache and cookies
  • Temporarily Disable browser extensions or plugins
  • Update your browser to the latest version
  • Check for any required request headers or parameters
  • Split large requests into smaller ones or compress data
  • Clear DNS cache
  • Seek further assistance if the issue persists

Verify the URL

It is a very common problem as users often mistype the URL or domain name in a hurry. Therefore, it is crucial to check the spelling of the domain name, as well as any special characters or empty spaces in the URL, as they can potentially cause a ‘400 Bad Request’ error.

To resolve this issue, please verify the URL and carefully check for any typos or missing parameters. Ensure that the URL has the correct structure, contains all the necessary parameters, and does not include any invalid characters.


Clear Browser Cache and Cookies

Browser cookies and cache store data and content from websites on the client’s side, improving the browsing experience.

The browser cache holds website files like text and images, reducing the need to request them from the web server and making page loading faster. Meanwhile, cookies store the user’s session history and preferences, enabling personalized browsing.

However, cookies can expire over time, and both website cookies and cache can become corrupted, leading to a 400 bad request error.

How to fix 400 bad request errors in Google Chrome?

To fix this, you need to clear the browser cache and cookies. If you are using Chrome browser, follow the steps given below:

Step 1: Depending on your browser, Go to the settings menu.

In Google Chrome, for example, you can find the settings menu by clicking on the three vertical dots located in the upper right corner of the window.

Step 2: To proceed, select “More tools” and then click on “Clear browsing data”.

Clear browsing data in Chrome

Clear browsing data on Chrome

Step 3: A pop-up window will be displayed, and you can choose all three options located under the “Basic” section as depicted in the picture below. These options consist of “Browsing history,” “Cookies and other site data,” and “Cached images and files.

Step 4: Click on “Clear data” to initiate the process.

Clearing data in Google Chrome

Clearing data in Google Chrome

Temporarily Disable browser extensions or plugins

Certain browser extensions or plugins can cause conflicts with the request sent to the web server, there is a possibility that the web server may consider the request as invalid or not properly formed.

Temporarily disabling them can help identify if any of these add-ons are triggering 400 Bad Request errors.

In the Chrome menu, click on Advanced Tools — Extensions. To disable them just uncheck the toggle on each of them. Make sure you disable all the extensions, it is very important to identify the reason.

Then, try to access the website again. If the error does not appear anymore, all you have to do is to find the extension causing the error. Turn on the installed extensions one by one and check the availability of the problem site after each one.


Update your browser to the latest version

Updating your browser can potentially help fix a 400 Bad Request error. When you update your browser, you ensure that it has the latest bug fixes, security patches, and compatibility improvements. These updates can address issues related to handling requests and processing data, which may help resolve the 400 Bad Request error.

Newer versions of browsers often include improvements in handling and validating HTTP requests, as well as enhanced support for web standards. By keeping your browser up to date, you increase the chances of encountering fewer errors and enjoying a smoother browsing experience.

To update the Google Chrome browser, you can follow these step-by-step instructions:

  • Open Google Chrome on your computer.
  • Click on the three-dot menu icon located at the top right corner of the browser window.
  • From the drop-down menu, hover over the “Help” option.
  • In the Help submenu, click on “About Google Chrome.” This will open a new tab with information about your current Chrome version.
  • Chrome will automatically check for updates and display the update status. If an update is available, it will begin downloading and installing automatically.
  • Once the update process is complete, click on the “Relaunch” button to restart Chrome and apply the updates.
  • After Chrome relaunches, it should be updated to the latest version.

Note: The steps may vary slightly depending on the version of Chrome or the operating system you are using.


Split large requests into smaller ones or compress data

If you try to upload a larger file size that exceeds the server limit, then you will experience a 400 Bad Request error.

There are a couple of things you can try. First, you can consider breaking down the request into smaller, more manageable pieces. By doing this, you’re giving the server a better chance to process each part without overwhelming it.

Another option is to compress the data before sending it. This can help reduce the overall size of the request, making it easier for the server to handle. Compression techniques can effectively shrink the data such as large audio files, videos, or images without losing any important information.


Clear DNS cache

Another common reason you might encounter a 400 Bad Request error is when the local DNS lookup data on your computer becomes corrupted or outdated.

It’s important to note that the browser doesn’t handle this data directly; it’s actually stored by your operating system. But don’t worry, we’re here to help!

We’ve put together a comprehensive and detailed guide that will walk you through clearing the DNS cache for both Windows and macOS operating systems. This should help resolve the issue and get you back to a smooth browsing experience in no time.


Read: 🚩 How to Easily Flush DNS Command Cache (Windows, Mac, Linux)


Seek Further Assistance if the issue persists

If you’ve tried all the methods mentioned above, but unfortunately the error persists. That’s most probably due to the issue lies with a misconfiguration of the website itself. In this case, it’s a good idea to reach out to the website administrators and kindly report the error.

However, if you are a website owner, it is recommended to reach out to the support team of your hosting provider. They possess the expertise to resolve this issue and provide you with the necessary assistance to fix it.


How to prevent the ‘400 Bad Request’ Error?

To minimize the occurrence of “400 Bad Request” errors, consider implementing the following preventive measures:

  • Double-check URLs and parameters: Before submitting a request, review the URL to ensure it is accurate and includes all the required parameters. This simple step can prevent potential errors.
  • Keep browsers and web applications up to date: Regularly update your browsers and web applications to their latest versions. This ensures compatibility with modern web standards and reduces the likelihood of encountering errors.
  • Validate user inputs on forms: When dealing with user input forms, implement proper validation to prevent the submission of invalid data. This validation can be done on the client side using JavaScript or on the server side to ensure data integrity.
  • Optimize website code and scripts: Regularly audit and optimize your website’s code and scripts to minimize the chances of syntax errors that could trigger a “400 Bad Request” error. Proper code organization and adherence to coding standards can help prevent such issues.
  • Implement proper error handling mechanisms: On the server side, implement robust error handling mechanisms that provide meaningful error messages to users when a “400 Bad Request” error occurs. Clear and informative error messages help users understand the issue and take appropriate action.
  • Regularly monitor server logs and error reports: Monitor your server logs and error reports to identify any recurring “400 Bad Request” errors. By proactively identifying and addressing these issues, you can prevent them from negatively impacting your website’s performance.

Summary

Understanding the “400 Bad Request” error is crucial for effectively taking steps to fix this issue. By identifying the common causes behind this error and following the troubleshooting steps discussed in this blog post, you can effectively resolve and prevent “400 Bad Request” errors.

Do not forget to check the URL, optimize your website’s code, and keep your browsers and web applications up to date. By implementing these best practices, you can enhance your website’s functionality and reduce the risk of encountering such errors in the future.
If you have any queries or suggestions regarding this post, please let us know in the comment section below.


Frequently Asked Questions

How do I fix a 400 Bad Request?

How to fix a 400 Bad request error? (8 methods)
1. Verify the URL
2. Clear Browser cache and cookies
3. Temporarily Disable browser extensions or plugins
4. Update your browser to the latest version
5. Check for any required request headers or parameters
6. Split large requests into smaller ones or compress data
7. Clear DNS cache
8. Seek further assistance if the issue persists

What is 400 Bad Request on Chrome?

A “400 Bad Request” error on Chrome is an HTTP status code that indicates the request sent to the server is invalid or malformed. This error occurs when the browser is unable to understand or process the request due to various reasons such as incorrect syntax, missing or incorrect parameters, or issues with the server configuration. I

What causes a 400 error?

The possible reasons that cause a 400 Bad gateway error are:
1. The causes of a 400 Bad request error are:
2. Incorrect URLs
3. Invalid or missing request headers
4. Corrupt Browser Cache and Cookies
5. DNS Lookup Cache
6. Large request size exceeding server limits
7. Invalid or unsupported HTTP methods
8. Server glitch


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.

Понравилась статья? Поделить с друзьями:
  • Гугл плей отчет об ошибке
  • Гугл ошибка 404 что это
  • Гугл плей маркет ошибка обновления приложений
  • Гугл плей не скачивает приложение ошибка 403
  • Гугл ошибка 400 как исправить