-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrait dans la documentation du support XML (#6495) #6698
Open
Convolutio
wants to merge
1
commit into
zestedesavoir:dev
Choose a base branch
from
Convolutio:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,29 +54,22 @@ Les autres verbes ne sont pas supportés. | |
Les formats d'entrées/sorties | ||
----------------------------- | ||
|
||
Par défaut, le serveur renvoie les réponses au format ``JSON`` mais il gère aussi le ``XML``. Pour demander au serveur de renvoyer les réponses en ``XML``, il faut utiliser l'en-tête ``Accept`` en spécifiant ``application/xml`` comme valeur (``application/json`` pour recevoir du ``JSON``). | ||
|
||
.. sourcecode:: bash | ||
|
||
$ curl -H "Accept: application/xml" https://zestedesavoir.com/api/membres/ | ||
|
||
Les `formats de sortie (en) <http://www.django-rest-framework.org/api-guide/renderers/>`_ sont renseignés dans le fichier ``settings.py`` sous l'attribut ``DEFAULT_RENDERER_CLASSES`` du dictionnaire ``REST_FRAMEWORK``. Pour Django Rest Framework, tous les formats de sorties sont des ``renderer``. | ||
Par défaut, le serveur renvoie les réponses au format ``JSON``. Les `formats de sortie (en) <http://www.django-rest-framework.org/api-guide/renderers/>`_ sont renseignés dans le fichier ``settings.py`` sous l'attribut ``DEFAULT_RENDERER_CLASSES`` du dictionnaire ``REST_FRAMEWORK``. Pour Django Rest Framework, tous les formats de sorties sont des ``renderer``. | ||
|
||
.. sourcecode:: python | ||
|
||
REST_FRAMEWORK = { | ||
'DEFAULT_RENDERER_CLASSES': ( | ||
'rest_framework.renderers.JSONRenderer', | ||
'rest_framework.renderers.XMLRenderer', | ||
'rest_framework.renderers.BrowsableAPIRenderer', | ||
), | ||
} | ||
|
||
Plusieurs formats d'entrées sont supportés par le serveur, à savoir le ``JSON`` (par défaut), l'``XML``, le formulaire et le multi part (``x-www-form-urlencoded``). Ces formats peuvent être renseignées avec l'en-tête ``Content-Type``. | ||
Plusieurs formats d'entrées sont supportés par le serveur, à savoir le ``JSON`` (par défaut), le formulaire et le multi part (``x-www-form-urlencoded``). Ces formats peuvent être renseignées avec l'en-tête ``Content-Type``. | ||
|
||
.. sourcecode:: bash | ||
|
||
$ curl -H "Content-Type: application/xml" https://zestedesavoir.com/api/membres/ | ||
$ curl -H "Content-Type: application/x-www-form-urlencoded" https://zestedesavoir.com/api/membres/ | ||
|
||
Les `formats d'entrée (en) <http://www.django-rest-framework.org/api-guide/parsers/>`_ sont renseignés dans le fichier ``settings.py`` sous l'attribut ``DEFAULT_PARSER_CLASSES`` du dictionnaire ``REST_FRAMEWORK``. Pour Django Rest Framework, tous les formats d'entrée sont des ``parser``. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idem ici : dans le projet zds le fichier |
||
|
||
|
@@ -85,7 +78,6 @@ Les `formats d'entrée (en) <http://www.django-rest-framework.org/api-guide/pars | |
REST_FRAMEWORK = { | ||
'DEFAULT_PARSER_CLASSES': ( | ||
'rest_framework.parsers.JSONParser', | ||
'rest_framework.parsers.XMLParser', | ||
'rest_framework.parsers.FormParser', | ||
'rest_framework.parsers.MultiPartParser', | ||
), | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dans le projet zds le fichier
settings.py
n'existe pas.Le fichier dans lequel se trouve le dictionnaire
REST_FRAMEWORK
est le suivant :zds/settings/abstract_base/django.py
.