Skip to content
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

Response 204 No Content on expected Array #79

Open
Ghriim opened this issue Jan 7, 2015 · 3 comments
Open

Response 204 No Content on expected Array #79

Ghriim opened this issue Jan 7, 2015 · 3 comments

Comments

@Ghriim
Copy link

Ghriim commented Jan 7, 2015

The convention used in my company is that a list API return a 204 with no content if no elements could be found to populate the response.
It won't return an empty array but just a 204 with an empty body.
In that case I got a "array<Path\To\My\Class>" must exist and implement a static fromCommand() method".

It would be nice that Guzzle could handle such a response since it's pretty standard I think.

@ludofleury
Copy link

"if no elements could be found to populate the response."
I miss some info, or is it a hack to avoid a 404 ?

@Ghriim
Copy link
Author

Ghriim commented Jan 7, 2015

No, it's not a hack.
The 404 would be the response code for the GET of one item.
The 204 would be the response code for the GET of an empty list of items.

@ludofleury
Copy link

Legit. +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants