WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 21 months ago

#24156 closed defect (bug)

If you submit file through wp curl it doesnt send boundary params for file mutlipart — at Initial Version

Reported by: samnani Owned by:
Milestone: Priority: normal
Severity: major Version: 3.5.1
Component: HTTP API Keywords: has-patch
Focuses: Cc:

Description

If you submit file through wp curl it doesnt send boundary params for file multipart, because in class-http.php at line 174 $r['body] array is converted to string ($rbody? = http_build_query( $rbody?, null, '&' );)

And curl wants array to send file boundary to rest api , in that case it fails.
ex.

$headersContent-type? = 'multipart/form-data';
$argsfile? = '@/pathtofile';
$request = new WP_Http;
$result = $request->request($url,$args);

Let me know if you have questions

Change History (0)

Note: See TracTickets for help on using tickets.