-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
As it's said in the docs
API Platform Core will automatically detect the best resolving format depending on:
enabled formats (link to docs for this / see below)
the Accept HTTP header
besides the Accept
header, it's possible to specify format in the url (e.g /api/users.json
)
.json corresponds to "Accept: application/json"
.jsonld corresponds to "Accept: application/ld+json"
.html corresponds to "Accept: text/html"
/api/users
{
"@context": "/api/contexts/User",
"@id": "/api/users",
"@type": "hydra:Collection",
"hydra:member": [
{
"@id": "/api/users/1",
"@type": "User",
"email": "foo@bar.com",
"id": 1,
"mobilePhone": null,
"roles": ["ROLE_USER"],
"username": "foo"
}
],
"hydra:search": {},
"hydra:totalItems": 2
}
/api/users.json
[
{
"email": "foo@bar.com",
"id": 1,
"mobilePhone": null,
"roles": ["ROLE_USER"],
"username": "foo"
}
]