Troubleshooting of HTTP errors: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
__TOC__
__TOC__


== 400 Bad Request ==
== Troubleshooting HTTP Status Errors ==


Root cause of 400 Bad Request. HTTP Error 400. The request is badly formed.
=== 400 Bad Request ===
* "the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing)"


Possible solution:
Root cause: The request itself is malformed. According to the spec, this means "the server cannot or will not process the request due to something perceived to be a client error" — such as invalid syntax, incorrect request message framing, or deceptive request routing.
* Modify the request headers


== 403 Forbidden Error ==
Possible fix:
* Review and correct the request headers
 
=== 403 Forbidden ===


See: [[How to fix the 403 forbidden error]]
See: [[How to fix the 403 forbidden error]]


== 404 File Not Found ==
=== 404 Not Found ===
Solution: Check if the accessed link is correct, see "404 Not Found | Possible solutions for pages not found"
 
Fix: Verify that the URL is correct. For more details, see
[[404 Not Found]], possible solutions for pages not found".
 
=== 405 Method Not Allowed ===
 
Fix: Confirm that the target resource supports the HTTP method you're using. For example, the endpoint may only accept POST requests while you're sending a GET request.
 
=== 414 Request-URI Too Large ===


== 405 Method Not Allowed Error ==
Fix: Switch from GET to POST so the data is sent in the request body instead of the URL.
Solution: Check if the accessed file or resource supports the HTTP protocol being used. For example, if the resource is restricted to POST requests but you're using GET.


== 414 Request-URI Too Large ==
=== 415 Unsupported Media Type ===
Solution: Change the request protocol to POST instead of GET


== 415 Unsupported Media Type ==
Fix: Explicitly declare the correct Content-Type or Content-Encoding in the request, or access the data directly. For instance, when calling a RESTful API, this error can often be resolved by adding the following header:


Solution: "Set the Content-Type or Content-Encoding in the request or direct access to the data." For example: When encountering this error with RESTful API, a possible solution is to add to the HTTP Headers:
<pre>
<pre>
Content-Type: application/json
Content-Type: application/json
</pre>
</pre>


== 429 Too Many Requests ==
=== 429 Too Many Requests ===
Root Cause:


* Accessing website resources or web service API too frequently
Root cause:
* The client is hitting the website or API more frequently than the service allows.


Solutions:
Fixes:
* '''Throttle your requests''': Add or increase a delay between requests based on your usage pattern and the service's limits (e.g., pause 1 second between calls).
* '''Check the API rate limits''': Consult the provider's documentation for limits such as Requests Per Minute (RPM) or Requests Per Day (RPD), and find out whether you can request a higher quota.
* '''Use exponential backoff''': Detect HTTP 429 responses in your
  application, then retry with progressively longer delays (e.g., 2s → 4s → 8s) until the request succeeds or a maximum retry count is reached.


* '''Adjust the delay time''' based on your usage patterns and the service's limits e.g. Increase the delay time between requests (e.g., add a 1-second pause between each request).
=== 502 Bad Gateway ===
* If accessing a web service API, Please refer to the documentation to understand the API access rate limits, such as:  (1) "Requests Per Minute" (RPM) – the maximum number of API requests you can make per minute, or (2) "Requests Per Day" (RPD) – the maximum number of API requests you can make per day. Check if you can request a higher quota limit from the service provider
* '''Implement exponential backoff retry mechanism''': Detect rate limit errors (HTTP 429) in your application. Increase the delay time with each failed retry (e.g., 2 seconds, 4 seconds, 8 seconds). Continue retrying until the request succeeds or maximum retry count is reached.


== 502 Bad Gateway ==
Cause:
Cause:
* Error occurs between network devices, users cannot directly handle it.
* A failure between upstream network devices/servers — not something the end user can fix directly.


Solutions:
Fixes:
* Bypass browser cache, refresh the page
* Hard-refresh the page to bypass the browser cache
* Try reconnecting after a while
* Wait a moment and try again


== Error 1020: Access Denied ==
=== Error 1020: Access Denied ===
* See link for understanding how to resolve Error 1020 Access Denied to get your website back online
* See the linked guide on resolving Error 1020 (Access Denied) to restore access to your website.


<pre>
== HTTP Cats or Dogs ==
Content-Type: application/json
</pre>


<div style="zoom: 0.4;">
https://http.cat/200.jpg
https://http.cat/200.jpg
From HTTP Cats
</div>
From [https://http.cat/ HTTP Cats]


Related websites:
Related websites:

Latest revision as of 16:49, 11 June 2026


icon_scale_pencil.png This article "Troubleshooting of HTTP errors" is still being written. If there are any incomplete parts, you are welcome to directly edit them. 這篇文章「Troubleshooting of HTTP errors」內容還在撰寫中,如果有不完整的部分,歡迎你直接動手修改


HTTP status code

🌐 Switch language: EN, 漢字


Troubleshooting HTTP Status Errors[edit]

400 Bad Request[edit]

Root cause: The request itself is malformed. According to the spec, this means "the server cannot or will not process the request due to something perceived to be a client error" — such as invalid syntax, incorrect request message framing, or deceptive request routing.

Possible fix:

  • Review and correct the request headers

403 Forbidden[edit]

See: How to fix the 403 forbidden error

404 Not Found[edit]

Fix: Verify that the URL is correct. For more details, see 404 Not Found, possible solutions for pages not found".

405 Method Not Allowed[edit]

Fix: Confirm that the target resource supports the HTTP method you're using. For example, the endpoint may only accept POST requests while you're sending a GET request.

414 Request-URI Too Large[edit]

Fix: Switch from GET to POST so the data is sent in the request body instead of the URL.

415 Unsupported Media Type[edit]

Fix: Explicitly declare the correct Content-Type or Content-Encoding in the request, or access the data directly. For instance, when calling a RESTful API, this error can often be resolved by adding the following header:

Content-Type: application/json

429 Too Many Requests[edit]

Root cause:

  • The client is hitting the website or API more frequently than the service allows.

Fixes:

  • Throttle your requests: Add or increase a delay between requests based on your usage pattern and the service's limits (e.g., pause 1 second between calls).
  • Check the API rate limits: Consult the provider's documentation for limits such as Requests Per Minute (RPM) or Requests Per Day (RPD), and find out whether you can request a higher quota.
  • Use exponential backoff: Detect HTTP 429 responses in your
 application, then retry with progressively longer delays (e.g., 2s → 4s → 8s) until the request succeeds or a maximum retry count is reached.

502 Bad Gateway[edit]

Cause:

  • A failure between upstream network devices/servers — not something the end user can fix directly.

Fixes:

  • Hard-refresh the page to bypass the browser cache
  • Wait a moment and try again

Error 1020: Access Denied[edit]

  • See the linked guide on resolving Error 1020 (Access Denied) to restore access to your website.

HTTP Cats or Dogs[edit]

200.jpg

From HTTP Cats

Related websites:

Other possible root causes[edit]

  • CDN (Content delivery network)

Mock HTTP status error page tools[edit]

The testing sites that can return 500 and various other HTTP status codes on demand

Related pages[edit]

References[edit]


Troubleshooting of ...

Template