Using rest api i can create a post, get blog category etc. but i cannot upload an image i am referring
https://github.com/WP-API/client-php/blob/master/library/WPAPI/Media.php
and
http://wp-api.org/#entities_media-meta_width
and my code is
$data = array('file'=>$filePath,'is_image'=>true);
print_r($data);
$headers = array('Content-Type' => 'application/octet-stream');
$response = $this->api->post(WPAPI::ROUTE_MEDIA, $headers, $data);
they talk about [$data in $response = $this->api->post(WPAPI::ROUTE_MEDIA, $headers, $data);]
what are the key value pairs used in $data?
Finally, I fixed it myself:
Here is the code:
Check the WordPress Media Gallery.
Enjoy!
try this.