Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#39166 closed defect (bug) (duplicate)

REST API and PHP HTTPClient wrapper error: Invalid JSON body passed

Reported by: peterigz Owned by:
Priority: normal Milestone:
Component: REST API Version: 4.7
Severity: normal Keywords:
Cc: Focuses: rest-api

Description

Since 4.7 I can no longer do a request with the php wrapper (https://github.com/woocommerce/wc-api-php), so doing:

$order = $client->get('orders/'.$order_id);

I get the error "Error: Invalid JSON body passed". The body being passed is of course blank because there's no data needed for a get request. I guess the issue is in class-wp-rest-request::parse_json_params?

I can work around forcing a value in the data parameter in Client->Get but obviously not ideal :)

Change History (1)

#1 @jnylen0
10 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Closing as a duplicate of #39150. Thanks for reporting, @peterigz - let's take a closer look over there.

Note: See TracTickets for help on using tickets.