WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #24156


Ignore:
Timestamp:
04/22/13 17:40:41 (12 months ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24156 – Description

    initial v1  
    1 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 ($r['body'] = http_build_query( $r['body'], null, '&' );) 
     1If 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: 
     2{{{ 
     3$r['body'] = http_build_query( $r['body'], null, '&' ); 
     4}}} 
    25 
    36And curl wants array to send file boundary to rest api , in that case it fails.  
    47ex. 
    5  
     8{{{ 
    69$headers['Content-type'] = 'multipart/form-data';    
    710$args['file'] = '@/pathtofile'; 
    811$request = new WP_Http; 
    9 $result = $request->request($url,$args); 
    10  
     12$result = $request->request($url,$args); 
     13}}} 
    1114Let me know if you have questions