[wp-trac] [WordPress Trac] #37618: String `$args['body']` passed to`WP_Http::get()` is lost, generates warning

WordPress Trac noreply at wordpress.org
Wed Aug 10 00:41:19 UTC 2016


#37618: String `$args['body']` passed to`WP_Http::get()` is lost, generates warning
--------------------------+-----------------------------
 Reporter:  dlh           |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  HTTP API      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Calling `wp_remote_get( 'https://www.example.com', array( 'body' => 'foo'
 ) )` eventually passes `'foo'` to `http_build_query()`, generating a
 warning: `Parameter 1 expected to be Array or Object. Incorrect value
 given in /wp-includes/Requests/Transport/cURL.php on line 507` (or `/wp-
 includes/Requests/Transport/fsockopen.php on line 353`).

 As far as I can tell, the 'body' value is also not included in the
 eventual request, but it is included with the same `wp_remote_get()` in
 4.5.3.

 I'm not comfortable enough with the HTTP API changes in this cycle to
 attempt a patch, if one is warranted.

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


More information about the wp-trac mailing list