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

struggling to pass arguments #14

Open
kageanrage opened this issue Jul 20, 2020 · 2 comments
Open

struggling to pass arguments #14

kageanrage opened this issue Jul 20, 2020 · 2 comments

Comments

@kageanrage
Copy link

regardless of what arguments I try to pass, they seem to get ignored, and I just get the same response, so I must have the formatting wrong. I can't see a clear example in the library documentation re. how to pass arguments / clarify the desired endpoint

e.g.
r = wpapi.get("posts")

(and then printing the json contents of the variable 'r')

... yields the same response as:

r = wpapi.get("posts?status=draft")

or

r = wpapi.get("posts?slug=member_post_abc")

If you could please clarify, I'd be grateful.

@d3v-null
Copy link
Owner

Hi there,
just a reminder that this repo is no longer maintained, and for this reason I would advise against people using it.

It looks like you're using the WP API correctly. https://developer.wordpress.org/rest-api/reference/posts/

There are tests that cover passing query string parameters like this, so it really should just work. https://github.com/derwentx/wp-api-python/blob/27e0385a9ceb3715c98768f3adf565142ba93387/tests/test_api.py#L405

I'd suggest if you have access to your webserver's raw access logs, to check that the correct params are indeed being passed through to the webserver. If they are, then this is not a problem with the client.

If you don't have access to the webserver's access logs, you can always try postman, mitmproxy or wireshark.

good luck!

@kageanrage
Copy link
Author

Thanks very much for your response. I'll do as you suggest!

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