[wp-trac] [WordPress Trac] #50218: rest_route is not passing query parameters

WordPress Trac noreply at wordpress.org
Thu May 21 14:31:20 UTC 2020


#50218: rest_route is not passing query parameters
--------------------------+-----------------------------
 Reporter:  masosky       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.3.1
 Severity:  blocker       |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50218>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list