Coduri de status HTTP pe înțelesul tuturor – part 1

Admin | Personals
14 Dec 2012

eroarehtmlHaideți să facem universul codurilor de eroare status HTTP un univers mai plăcut. Poate și învățăm ceva 🙂

Câți dintre noi nu s-au lovit în timpul peregrinărilor prin meandrele web-ului de mesaje de eroare de genul “404 or Not Found error message”. Apare o pagina alba, scris cu negru, foarte anostă and stuff, care-ți indică faptul că respectivul browser nu poate găsi ceea ce căutați pe web.

Sunt modalități de a face puțin mai “dulce” aceste poticniri. Puteți întâlni următoarele mesaje de eroare status :

1 – Codul 100 – Continue, care ne spune că : “The client SHOULD continue with its request. This interim response is used to inform the client that the initial part of the request has been received and has not yet been rejected by the server. The client SHOULD continue by sending the remainder of the request or, if the request has already been completed, ignore this response. The server MUST send a final response after the request has been completed”.

HTTP-Status-Cats-100

2 – Codul 200 – OK, care ne spune că : “The request has succeeded. The information returned with the response is dependent on the method used in the request, for example : GET an entity corresponding to the requested resource is sent in the response; HEAD the entity-header fields corresponding to the requested resource are sent in the response without any message-body; POST an entity describing or containing the result of the action; TRACE an entity containing the request message as received by the end server.”

HTTP-Status-Cats-200

3 – Codul 206 – Partial Content, care ne spune că : “The server has fulfilled the partial GET request for the resource. The request MUST have included a Range header field indicating the desired range, and MAY have included an If-Range header field to make the request conditional.”

HTTP-Status-Cats-206

 

4 – Codul 302 – Found, care ne spune că : “The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field. The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s). If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.”

HTTP-Status-Cats-302

 

5 – Codul 401 – Unauthorised, care înseamnă că : “The request requires user authentication. The response MUST include a WWW-Authenticate header field containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field. If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity might include relevant diagnostic information. HTTP access authentication is explained in “HTTP Authentication: Basic and Digest Access Authentication””

HTTP-Status-Cats-401

6 – Codul 402 – Payment required, ce este un cod momentan rezervat pentru o folosire ulterioară.

HTTP-Status-Cats-402

7 – Codul 403 – Forbidden, care înseamnă că : “The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.”

HTTP-Status-Cats-403

8 – Codul 404 – Not Found, care ne spune că : “The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.”

HTTP-Status-Cats-404

9 – Codul 406 – Not Acceptable, care ne spune că : “The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.Unless it was a HEAD request, the response SHOULD include an entity containing a list of available entity characteristics and location(s) from which the user or user agent can choose the one most appropriate. The entity format is specified by the media type given in the Content-Type header field. Depending upon the format and the capabilities of the user agent, selection of the most appropriate choice MAY be performed automatically. However, this specification does not define any standard for such automatic selection.”

HTTP-Status-Cats-406

Continuăm într-un post viitor 😀

Tags: , , , , , , , , , , ,

4 Comments

  1. Adrian says:

    Prima eroare: Nu sunt erori HTML, sunt HTTP Status Codes ( Nu error codes, ca nu toate sunt de eroare 😛 )

  2. Suzy says:

    Eu ma chinui de 6 luni sa schimb contentul la erorile alea, dar se pare ca IT-ul din casa nu ajuta 🙁
    Asa ca astept si urmatoarele parti 🙂

Leave a Reply

UA-36392182-1
Read more:
Cum să parchezi la hipermarchee

Într-o zi în care totul e plin ochi, colcăie de oameni veniți la cumpărături, există și oameni who ride like...

Close