| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/fr/docs/Web/HTTP/Reference/Status/204 | [Back] [Original] |
Get to know MDN better
Cette page a t traduite partir de l'anglais par la communaut. Vous pouvez contribuer en rejoignant la communaut francophone sur MDN Web Docs.
Le code de statut de rponse de succs HTTP 204 No Content indique que la requte a russi, mais que le client n'a pas besoin de quitter la page actuelle.
Une rponse 204 est mise en cache par dfaut, et un en-tte ETag est inclus dans ce cas.
Une rponse 204 No Content en rponse ces mthodes de requte a la signification et les rsultats suivants :
DELETE : L'action a russi, aucune information supplmentaire n'a besoin d'tre fournie.PUT : L'action a russi, et la valeur ETag contient l'tiquette d'entit pour la nouvelle reprsentation de la ressource cible.Une rponse 204 peut tre utilise lors de l'implmentation d'une fonctionnalit enregistrer et continuer l'dition pour des applications comme les wikis.
Dans ce cas, une requte PUT peut tre utilise pour enregistrer le contenu de la page, et une rponse 204 No Content indique au navigateur que l'diteur ne doit pas tre remplac par un autre contenu.
Notez que la rponse ne doit inclure aucun contenu ni l'en-tte Content-Length (les navigateurs peuvent rejeter les rponses qui incluent du contenu).
204 No Content
Dans cet exemple, le client envoie une requte pour supprimer une image en utilisant la mthode DELETE.
La requte inclut un en-tte Authorization avec un jeton pour authentifier la requte :
DELETE /image/123 HTTP/1.1
Host: example.com
Authorization: Bearer 1234abcd
Aprs la suppression russie de l'image, le serveur rpond avec une rponse 204 sans corps, indiquant qu'aucune information supplmentaire n'a besoin d'tre envoye au client.
HTTP/1.1 204 No Content
Date: Wed, 26 Jun 2024 12:00:00 GMT
Server: Apache/2.4.1 (Unix)
Dans cet exemple, le client envoie une requte PUT pour mettre jour les informations du profil d'une utilisateurice.
La requte inclut un en-tte Authorization avec un jeton pour authentifier la requte :
PUT /users/123 HTTP/1.1
Host: example.com
Content-Type: application/json
Authorization: Bearer 1234abcd
{
"name": "Sandra Smith",
"email": "sandra@example.com"
}
Aprs la mise jour russie du profil utilisateur, le serveur rpond avec une rponse 204.
L'en-tte ETag contient l'tiquette d'entit pour la ressource mise jour :
HTTP/1.1 204 No Content
Date: Wed, 26 Jun 2024 12:00:00 GMT
ETag: "33a64df551425fcc55e4d42a148795d9f25f89d4"
Server: Apache/2.4.1 (Unix)
| Spcification |
|---|
| HTTP Semantics # status.204 |
Cette page a t modifie le 8 juil. 2026 par les contributeurices du MDN.
Raison : CORS dsactivRaison : l'en-tte CORS Access-Control-Allow-Origin ne correspond pas xyz Raison : l'en-tte CORS Access-Control-Allow-Origin est manquantReason: CORS header 'Origin' cannot be addedReason: CORS preflight channel did not succeedRaison: la requte CORS a chouReason: CORS request external redirect not allowedRaison : la requte CORS n'utilise pas HTTPReason: Credential is not supported if the CORS header 'Access-Control-Allow-Origin' is '*'Reason: Did not find method in CORS header 'Access-Control-Allow-Methods'Reason: expected 'true' in CORS header 'Access-Control-Allow-Credentials'Reason: invalid token 'xyz' in CORS header 'Access-Control-Allow-Headers'Reason: invalid token 'xyz' in CORS header 'Access-Control-Allow-Methods'Reason: missing token 'xyz' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channelReason: Multiple CORS header 'Access-Control-Allow-Origin' not allowedAcceptAccept-CHAccept-EncodingAccept-LanguageAccept-PatchAccept-PostAccept-RangesAccess-Control-Allow-CredentialsAccess-Control-Allow-HeadersAccess-Control-Allow-MethodsAccess-Control-Allow-OriginAccess-Control-Expose-HeadersAccess-Control-Max-AgeAccess-Control-Request-HeadersAccess-Control-Request-MethodActivate-Storage-AccessAgeAllowAlt-SvcAlt-UsedAttribution-Reporting-EligibleAttribution-Reporting-Register-SourceAttribution-Reporting-Register-TriggerAuthorizationAvailable-DictionaryCache-ControlClear-Site-DataConnectionContent-DigestContent-DispositionContent-DPRContent-EncodingContent-LanguageContent-LengthContent-LocationContent-RangeContent-Security-PolicyContent-Security-Policy-Report-OnlyContent-TypeCookieCritical-CHCross-Origin-Embedder-PolicyCross-Origin-Embedder-Policy-Report-OnlyCross-Origin-Opener-PolicyCross-Origin-Resource-PolicyDateDevice-MemoryDictionary-IDDNTDownlinkDPREarly-DataECTETagExpectExpect-CTExpiresForwardedFromHostIdempotency-KeyIf-MatchIf-Modified-SinceIf-None-MatchIf-RangeIf-Unmodified-SinceIntegrity-PolicyIntegrity-Policy-Report-OnlyKeep-AliveLast-ModifiedLinkLocationMax-ForwardsNELNo-Vary-SearchObserve-Browsing-TopicsOriginOrigin-Agent-ClusterPermissions-PolicyPermissions-Policy-Report-OnlyPragmaPreferPreference-AppliedPriorityProxy-AuthenticateProxy-AuthorizationRangeRefererReferrer-PolicyRefreshReport-ToReporting-EndpointsRepr-DigestRetry-AfterRTTSave-DataSec-Browsing-TopicsSec-CH-Device-MemorySec-CH-DPRSec-CH-Prefers-Color-SchemeSec-CH-Prefers-Reduced-MotionSec-CH-Prefers-Reduced-TransparencySec-CH-UASec-CH-UA-ArchSec-CH-UA-BitnessSec-CH-UA-Form-FactorsSec-CH-UA-Full-VersionSec-CH-UA-Full-Version-ListSec-CH-UA-MobileSec-CH-UA-ModelSec-CH-UA-PlatformSec-CH-UA-Platform-VersionSec-CH-UA-WoW64Sec-CH-Viewport-HeightSec-CH-Viewport-WidthSec-CH-WidthSec-Fetch-DestSec-Fetch-ModeSec-Fetch-SiteSec-Fetch-Storage-AccessSec-Fetch-UserSec-GPCSec-Private-State-TokenSec-Private-State-Token-Crypto-VersionSec-Private-State-Token-LifetimeSec-PurposeSec-Redemption-RecordSec-Speculation-TagsSec-WebSocket-AcceptSec-WebSocket-ExtensionsSec-WebSocket-KeySec-WebSocket-ProtocolSec-WebSocket-VersionServeurServer-TimingService-WorkerService-Worker-AllowedService-Worker-Navigation-PreloadSet-CookieSet-LoginSourceMapSpeculation-RulesStrict-Transport-SecuritySupports-Loading-ModeTETiming-Allow-OriginTkTrailerTransfer-EncodingUpgradeUpgrade-Insecure-RequestsUse-As-DictionaryUser-AgentVaryViaViewport-WidthWant-Content-DigestWant-Repr-DigestWarningWidthWWW-AuthenticateX-Content-Type-OptionsX-DNS-Prefetch-ControlX-Forwarded-ForX-Forwarded-HostX-Forwarded-ProtoX-Frame-OptionsX-Permitted-Cross-Domain-PoliciesX-Powered-ByX-Robots-TagX-XSS-Protection100 Continue101 Switching Protocols102 Processing103 Early Hints200 OK201 Created202 Accepted203 Non-Authoritative Information204 No Content205 Reset Content206 Partial Content207 Multi-Status208 Already Reported226 IM Used300 Multiple Choices301 Moved Permanently302 Found303 See Other304 Not Modified307 Temporary Redirect308 Permanent Redirect400 Bad Request401 Unauthorized402 Payment Required403 Forbidden404 Not Found405 Method Not Allowed406 Not Acceptable407 Proxy Authentication Required408 Request Timeout409 Conflict410 Gone411 Length Required412 Precondition Failed413 Payload Too Large414 URI Too Long415 Unsupported Media Type416 Range Not Satisfiable417 Expectation Failed418 I'm a teapot421 Misdirected Request422 Unprocessable Entity423 Locked424 Failed Dependency425 Too Early426 Upgrade Required428 Precondition Required429 Too Many Requests431 Request Header Fields Too Large451 Unavailable For Legal Reasons500 Internal Server Error501 Not Implemented502 Bad Gateway503 Service Unavailable504 Gateway Timeout505 HTTP Version Not Supported506 Variant Also Negotiates507 Insufficient Storage508 Loop Detected510 Not Extended511 Network Authentication Requiredbase-uriblock-all-mixed-contentchild-srcconnect-srcdefault-srcfenced-frame-srcfont-srcform-actionframe-ancestorsframe-srcimg-srcmanifest-srcmedia-srcobject-srcprefetch-srcreport-toreport-urirequire-trusted-types-forsandboxscript-srcscript-src-attrscript-src-elemstyle-srcstyle-src-attrstyle-src-elemtrusted-typesupgrade-insecure-requestsworker-srcaccelerometerambient-light-sensoraria-notifyattribution-reportingautoplaybluetoothbrowsing-topicscameracaptured-surface-controlch-ua-high-entropy-valuescompute-pressurecross-origin-isolateddeferred-fetchdeferred-fetch-minimaldisplay-captureencrypted-mediafullscreengamepadgeolocationgyroscopehididentity-credentials-getidle-detectionlanguage-detectorlanguage-modellocal-fontslocal-networklocal-network-accessloopback-networkmagnetometermicrophonemidion-device-speech-recognitionotp-credentialspaymentpicture-in-pictureprivate-state-token-issuanceprivate-state-token-redemptionpublickey-credentials-createpublickey-credentials-getscreen-wake-lockserialspeaker-selectionstorage-accesssummarizertranslatorusbweb-sharewindow-managementxr-spatial-trackingCertaines parties de ce contenu sont protges par le droit d'auteur 19982026 des contributeurs individuels de mozilla.org. Contenu disponible sous une licence Creative Commons.
| Web Proxy Viewer | New URL | Original Page |