Response body is optional and can be returned.

Aperta
#444 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Ambito
api, documentation

Direzione di ricerca

Inizia dalla sezione 13.2.1, «PUT», delle linee guida API e confronta i relativi esempi di 202 Accepted e 201 Created con RFC 7231. Chiarisci che il corpo di una risposta 202 è facoltativo e spiega cosa devono aspettarsi i client quando ne viene incluso uno; il testo aggiornato delle linee guida è il criterio di completamento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

**_13.2.1. PUT
Services MAY enable PUT requests for entity creation.

PUT https://api.contoso.com/v1.0/databases/db1
In this scenario the databases segment is processing the PUT operation.

HTTP/1.1 202 Accepted
Operation-Location: https://api.contoso.com/v1.0/operations/123
For services that need to return a 201 Created here, use the hybrid flow described below.

The 202 Accepted should return no body. The 201 Created case should return the body of the target resource._**

Please find additional notes that body is optional:

According to the HTTP/1.1 specification (RFC 7231), the 202 Accepted status code is optional when it comes to including a response body. The decision to include a response body depends on the specific use case and the API design.

When you choose to include a response body with a 202 Accepted response, it is typically used to provide additional information about the ongoing process or to give details on how to track the progress of the operation. This might include a status message or a reference to a resource that provides the current status of the operation.

If you decide to include a response body, it is important to ensure that the response is properly documented in your API documentation so that clients know what to expect and how to handle the response.

Lingua principale
Nessun dato sulla lingua
Stelle
23.3k
Fork
2.7k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/api-guidelines

Tutte le issue di microsoft/api-guidelines

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.