HTTP狀態(tài)碼(HTTP Status Code)
Jun 06, 2016 pm 08:00 PM一些常見的狀態(tài)碼為: 200 - 服務器成功返回網(wǎng)頁 404 - 請求的網(wǎng)頁不存在 503 - 服務不可用 詳細分解: 1xx(臨時響應) 表示臨時響應并需要請求者繼續(xù)執(zhí)行操作的狀態(tài)代碼。 代碼 說明 100 (繼續(xù)) 請求者應當繼續(xù)提出請求。 服務器返回此代碼表示已收到請
一些常見的狀態(tài)碼為:
?
200 - 服務器成功返回網(wǎng)頁
404 - 請求的網(wǎng)頁不存在
503 - 服務不可用
詳細分解:
1xx(臨時響應)
表示臨時響應并需要請求者繼續(xù)執(zhí)行操作的狀態(tài)代碼。
代碼?? 說明
100?? (繼續(xù)) 請求者應當繼續(xù)提出請求。 服務器返回此代碼表示已收到請求的第一部分,正在等待其余部分。
101?? (切換協(xié)議) 請求者已要求服務器切換協(xié)議,服務器已確認并準備切換。
2xx (成功)
表示成功處理了請求的狀態(tài)代碼。
代碼?? 說明
200?? (成功)? 服務器已成功處理了請求。 通常,這表示服務器提供了請求的網(wǎng)頁。
201?? (已創(chuàng)建)? 請求成功并且服務器創(chuàng)建了新的資源。
202?? (已接受)? 服務器已接受請求,但尚未處理。
203?? (非授權信息)? 服務器已成功處理了請求,但返回的信息可能來自另一來源。
204?? (無內容)? 服務器成功處理了請求,但沒有返回任何內容。
205?? (重置內容) 服務器成功處理了請求,但沒有返回任何內容。
206?? (部分內容)? 服務器成功處理了部分 GET 請求。
3xx (重定向)
表示要完成請求,需要進一步操作。 通常,這些狀態(tài)代碼用來重定向。
代碼?? 說明
300?? (多種選擇)? 針對請求,服務器可執(zhí)行多種操作。 服務器可根據(jù)請求者 (user agent) 選擇一項操作,或提供操作列表供
請求者選擇。
301?? (永久移動)? 請求的網(wǎng)頁已永久移動到新位置。 服務器返回此響應(對 GET 或 HEAD 請求的響應)時,會自動將請求者轉
到新位置。
302?? (臨時移動)? 服務器目前從不同位置的網(wǎng)頁響應請求,但請求者應繼續(xù)使用原有位置來進行以后的請求。
303?? (查看其他位置) 請求者應當對不同的位置使用單獨的 GET 請求來檢索響應時,服務器返回此代碼。
304?? (未修改) 自從上次請求后,請求的網(wǎng)頁未修改過。 服務器返回此響應時,不會返回網(wǎng)頁內容。
305?? (使用代理) 請求者只能使用代理訪問請求的網(wǎng)頁。 如果服務器返回此響應,還表示請求者應使用代理。
307?? (臨時重定向)? 服務器目前從不同位置的網(wǎng)頁響應請求,但請求者應繼續(xù)使用原有位置來進行以后的請求。
4xx(請求錯誤)
這些狀態(tài)代碼表示請求可能出錯,妨礙了服務器的處理。
代碼?? 說明
400?? (錯誤請求) 服務器不理解請求的語法。
401?? (未授權) 請求要求身份驗證。 對于需要登錄的網(wǎng)頁,服務器可能返回此響應。
403?? (禁止) 服務器拒絕請求。
404?? (未找到) 服務器找不到請求的網(wǎng)頁。
405?? (方法禁用) 禁用請求中指定的方法。
406?? (不接受) 無法使用請求的內容特性響應請求的網(wǎng)頁。
407?? (需要代理授權) 此狀態(tài)代碼與 401(未授權)類似,但指定請求者應當授權使用代理。
408?? (請求超時)? 服務器等候請求時發(fā)生超時。
409?? (沖突)? 服務器在完成請求時發(fā)生沖突。 服務器必須在響應中包含有關沖突的信息。
410?? (已刪除)? 如果請求的資源已永久刪除,服務器就會返回此響應。
411?? (需要有效長度) 服務器不接受不含有效內容長度標頭字段的請求。
412?? (未滿足前提條件) 服務器未滿足請求者在請求中設置的其中一個前提條件。
413?? (請求實體過大) 服務器無法處理請求,因為請求實體過大,超出服務器的處理能力。
414?? (請求的 URI 過長) 請求的 URI(通常為網(wǎng)址)過長,服務器無法處理。
415?? (不支持的媒體類型) 請求的格式不受請求頁面的支持。
416?? (請求范圍不符合要求) 如果頁面無法提供請求的范圍,則服務器會返回此狀態(tài)代碼。
417?? (未滿足期望值) 服務器未滿足"期望"請求標頭字段的要求。
5xx(服務器錯誤)
這些狀態(tài)代碼表示服務器在嘗試處理請求時發(fā)生內部錯誤。 這些錯誤可能是服務器本身的錯誤,而不是請求出錯。
代碼?? 說明
500?? (服務器內部錯誤)? 服務器遇到錯誤,無法完成請求。
501?? (尚未實施) 服務器不具備完成請求的功能。 例如,服務器無法識別請求方法時可能會返回此代碼。
502?? (錯誤網(wǎng)關) 服務器作為網(wǎng)關或代理,從上游服務器收到無效響應。
503?? (服務不可用) 服務器目前無法使用(由于超載或停機維護)。 通常,這只是暫時狀態(tài)。
504?? (網(wǎng)關超時)? 服務器作為網(wǎng)關或代理,但是沒有及時從上游服務器收到請求。
505?? (HTTP 版本不受支持) 服務器不支持請求中所用的 HTTP 協(xié)議版本。

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The method to get the current session ID in PHP is to use the session_id() function, but you must call session_start() to successfully obtain it. 1. Call session_start() to start the session; 2. Use session_id() to read the session ID and output a string similar to abc123def456ghi789; 3. If the return is empty, check whether session_start() is missing, whether the user accesses for the first time, or whether the session is destroyed; 4. The session ID can be used for logging, security verification and cross-request communication, but security needs to be paid attention to. Make sure that the session is correctly enabled and the ID can be obtained successfully.

To extract substrings from PHP strings, you can use the substr() function, which is syntax substr(string$string,int$start,?int$length=null), and if the length is not specified, it will be intercepted to the end; when processing multi-byte characters such as Chinese, you should use the mb_substr() function to avoid garbled code; if you need to intercept the string according to a specific separator, you can use exploit() or combine strpos() and substr() to implement it, such as extracting file name extensions or domain names.

UnittestinginPHPinvolvesverifyingindividualcodeunitslikefunctionsormethodstocatchbugsearlyandensurereliablerefactoring.1)SetupPHPUnitviaComposer,createatestdirectory,andconfigureautoloadandphpunit.xml.2)Writetestcasesfollowingthearrange-act-assertpat

In PHP, the most common method is to split the string into an array using the exploit() function. This function divides the string into multiple parts through the specified delimiter and returns an array. The syntax is exploit(separator, string, limit), where separator is the separator, string is the original string, and limit is an optional parameter to control the maximum number of segments. For example $str="apple,banana,orange";$arr=explode(",",$str); The result is ["apple","bana

JavaScript data types are divided into primitive types and reference types. Primitive types include string, number, boolean, null, undefined, and symbol. The values are immutable and copies are copied when assigning values, so they do not affect each other; reference types such as objects, arrays and functions store memory addresses, and variables pointing to the same object will affect each other. Typeof and instanceof can be used to determine types, but pay attention to the historical issues of typeofnull. Understanding these two types of differences can help write more stable and reliable code.

std::chrono is used in C to process time, including obtaining the current time, measuring execution time, operation time point and duration, and formatting analysis time. 1. Use std::chrono::system_clock::now() to obtain the current time, which can be converted into a readable string, but the system clock may not be monotonous; 2. Use std::chrono::steady_clock to measure the execution time to ensure monotony, and convert it into milliseconds, seconds and other units through duration_cast; 3. Time point (time_point) and duration (duration) can be interoperable, but attention should be paid to unit compatibility and clock epoch (epoch)

In PHP, to pass a session variable to another page, the key is to start the session correctly and use the same $_SESSION key name. 1. Before using session variables for each page, it must be called session_start() and placed in the front of the script; 2. Set session variables such as $_SESSION['username']='JohnDoe' on the first page; 3. After calling session_start() on another page, access the variables through the same key name; 4. Make sure that session_start() is called on each page, avoid outputting content in advance, and check that the session storage path on the server is writable; 5. Use ses

ToaccessenvironmentvariablesinPHP,usegetenv()orthe$_ENVsuperglobal.1.getenv('VAR_NAME')retrievesaspecificvariable.2.$_ENV['VAR_NAME']accessesvariablesifvariables_orderinphp.iniincludes"E".SetvariablesviaCLIwithVAR=valuephpscript.php,inApach
