Troubleshooting of HTTP errors: Difference between revisions

Jump to navigation Jump to search
no edit summary
mNo edit summary
No edit summary
Line 2: Line 2:


HTTP status code
HTTP status code
{{LanguageSwitcher | content = [[Troubleshooting of HTTP errors | EN]], [[Troubleshooting of HTTP errors in Mandarin | 漢字]] }}


__TOC__
__TOC__
Line 8: Line 10:


Root cause of 400 Bad Request. HTTP Error 400. The request is badly formed.
Root cause of 400 Bad Request. HTTP Error 400. The request is badly formed.
* "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)"<ref>[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400 400 Bad Request - HTTP | MDN]</ref>
* "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)"


Possibile solution:
Possible solution:
* Modify the request headers
* Modify the request headers


== 403 Forbidden Error ==
== 403 Forbidden Error ==


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


== 404 File Not Found ==
== 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"


== 405 Method Not Allowed Error ==
== 405 Method Not Allowed Error ==
解決方法:檢查存取的文件或資源支援呼叫使用的 HTTP protocol <ref>[https://dotblogs.com.tw/cotton/2018/03/01/132336 使用Http Post呼叫api卻收到405 method not allowed | 攻城獅的學習筆記 - 點部落]</ref>,例如限制使用 POST ,卻使用 GET 存取。
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 ==
== 414 Request-URI Too Large ==
解決方法:請求協議改用 POST 而不是 GET<ref>[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414 414 URI Too Long - HTTP | MDN]</ref>
Solution: Change the request protocol to POST instead of GET


== 415 Unsupported Media Type ==
== 415 Unsupported Media Type ==


解決方法:「於請求中設置的 {{kbd | key=Content-Type}} 或 {{kbd | key=Content-Encoding}} 或對資料的直接訪問」。參考資料:[https://developer.mozilla.org/zh-TW/docs/Web/HTTP/Status/415 415 Unsupported Media Type - HTTP | MDN]
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:
 
例如:RESTful API 遇到該錯誤,可能解決方式是 HTTP Headers 加入
<pre>
<pre>
Content-Type: application/json
Content-Type: application/json
Line 36: Line 36:


== 429 Too Many Requests ==
== 429 Too Many Requests ==
原因:
Cause:
* 太頻繁存取網站資源
* Accessing website resources too frequently
 
解決方法:
* 調整存取頻率
* 如果是存取網路服務 API,請閱讀文件了解 API 本身的存取頻率限制 (Rate Limits)


參考資料
Solutions:
* [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429 429 Too Many Requests - HTTP | MDN]
* Adjust access frequency
* If accessing a web service API, read the documentation to understand the API's rate limits


== 502 Bad Gateway ==
== 502 Bad Gateway ==
原因:
Cause:
* 因為是網路設備間發生錯誤,使用者並無法直接處理<ref>[https://hostingpill.com/zh-TW/502%E9%8C%AF%E8%AA%A4%E7%9A%84%E7%B6%B2%E9%97%9C/ 什麼是502 Bad Gateway錯誤以及如何解決(輕鬆修復指南)]</ref>。
* Error occurs between network devices, users cannot directly handle it.
 
解決方法:
* [https://zh.wikipedia.org/zh-tw/Help:%E7%BB%95%E8%BF%87%E6%B5%8F%E8%A7%88%E5%99%A8%E7%BC%93%E5%AD%98 繞過瀏覽器快取],瀏覽器重新整理頁面
* 過一陣子再重新連線


參考資料
Solutions:
* [https://developer.mozilla.org/zh-TW/docs/Web/HTTP/Status/502 502 Bad Gateway - HTTP | MDN]
* Bypass browser cache, refresh the page
* Try reconnecting after a while


== Error 1020: Access Denied ==
== Error 1020: Access Denied ==
* [https://www.affde.com/zh-TW/error-1020-access-denied.html 了解如何解決錯誤 1020 訪問被拒絕以使您的網站重新上線 - Affde營銷]
* See link for understanding how to resolve Error 1020 Access Denied to get your website back online


<pre>
<pre>
Line 64: Line 58:
</pre>
</pre>


: https://http.cat/200.jpg
https://http.cat/200.jpg
: From [https://http.cat/ HTTP Cats]
From HTTP Cats


Related websites
Related websites:
* [https://httpstatusdogs.com/ HTTP Status Dogs]
* [https://httpstatusdogs.com/ HTTP Status Dogs]


== Other possibile root cause ==
== Other possible root causes ==
* CDN ([https://en.wikipedia.org/wiki/Content_delivery_network Content delivery network])
* CDN (Content delivery network)


== Related pages ==
== Related pages ==

Navigation menu