404 when filtering by post type #59

Closed
abulte opened this Issue Dec 15, 2013 · 8 comments

Projects

None yet

3 participants

@abulte
abulte commented Dec 15, 2013

Hi,

I have a strange problem when I try to make this plugin work on one site I recently got from a client.

When I try to access http://lpdf.dev/wp-json.php/posts, everything works smoothly, I can see my posts of different types.

But when I query http://lpdf.dev/wp-json.php/posts?type=faute (faute is a custom type) or even http://lpdf.dev/wp-json.php/posts?type=post I get a 404 status code AND some data in my JSON :-/

WordPress is v3.6.1. Any idea how to fix or at least debug this?

Thanks.

@abulte
abulte commented Dec 16, 2013

I get a 200 but the data is not filtered by post_type. Out of curiosity: why would it work? Seems inconsistent with the doc.

@abulte
abulte commented Dec 16, 2013

Just to be clear: when querying http://lpdf.dev/wp-json.php/posts?type=faute I get the correct data but the status code is 404.

@abulte
abulte commented Dec 16, 2013

For those passing by, I ended up circumventing the problem by creating my own endpoint based on my custom post type, just follow the docs: https://github.com/WP-API/WP-API/blob/master/docs/guides/extending.md

@rachelbaker
Member

@abulte Is there anything that still needs attention in this issue to be resolved?

@abulte
abulte commented Feb 18, 2014

@rachelbaker thanks for checking in. Like I said I got around the problem by using a custom endpoint. So the original bug may still be present, we need to test against the latest release which I haven't had a chance to do. But if nobody else has complained about that...

@rachelbaker rachelbaker self-assigned this Feb 21, 2014
@rmccue
Member
rmccue commented Mar 4, 2014

I suspect this is related to the same issue that made #46 necessary. Can you try using the latest version from here and see if that fixes it? :)

@rmccue rmccue added this to the 1.0 milestone Mar 4, 2014
@rachelbaker
Member

@abulte To clarify....you should be able to GET all posts of a certain post type by passing the query string. However, you cannot POST data using a query string url. I am not sure if that is the issue here, but I know our documentation surrounding this could use some clarification.

@rmccue
Member
rmccue commented Apr 6, 2014

Closing, as we don't have any further feedback. Let me know if we can do anything further here.

@rmccue rmccue closed this Apr 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment