Opened 6 years ago
Closed 6 years ago
#50218 closed defect (bug) (invalid)
rest_route is not passing query parameters
| Reported by: | masosky | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | REST API | Version: | 5.3.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Hi,
I tried to reach the Woocommerce API through http://localhost/wp-json/wc/v2 but I had to use the "rest_route" options because the "wp-json" endpoint is not available.
The problem is the following, I need to access to this URL:
http://localhost:3007/index.php?rest_route=/wc/v2/product and pass some query parameters
for example:
http://localhost:3007/index.php?rest_route=/wc/v2/product?a=1
if I try this, the route does not exists
Also if I try this
http://localhost:3007/index.php?rest_route=/wc/v2/product&a=1
It is not working
Why WordPress is not redirecting the parameters or headers when using "rest_route"?
It looks like a bug.
Thank you
Change History (4)
#2
@
6 years ago
- Component General → REST API
- Keywords reporter-feedback close added
- Severity blocker → normal
Hi @masosky,
Thanks for opening a ticket, and welcome to trac!
I'm not able to replicate, for instance the following URLs return what I'd expect.
http://wp-api.test/index.php?rest_route=%2Fwp%2Fv2%2Fposts&_fields=author
http://wp-api.test/index.php?rest_route=%2Fwp%2Fv2%2Fposts&author=3
Could you try calling a built in route instead of a WooCommerce route?
#3
@
6 years ago
You are right,
It seems it is a Woocommerce problem.
Thank you for your fast response
#4
@
6 years ago
- Keywords reporter-feedback close removed
- Milestone Awaiting Review
- Resolution → invalid
- Status new → closed
Thanks for the follow-up!
This Trac is used for enhancements and bug reporting for the WordPress core software, not for third-party plugins like WooCommerce.
Please try their support via https://woocommerce.com/ or the support forums to get help with your site.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Sorry I did not mention that if I try to encode the URL the problem is also happening
For example:
http://localhost:3007/index.php?rest_route=%2Fwc%2Fv2%2Fproduct%26a%3D1