@sterndata
Hi, I am trying to find a PHP client class !
Which there isn’t any mentioned here:
https://developer.wordpress.org/rest-api/using-the-rest-api/client-libraries/
any thing?
I can google it or you can. 🙂 I think it’s best that you do it.
Something like “rest API wordpress php examples”
@sterndata
Most of them are related to WordPress based applications, Not independent PHP applications
I tested 2-3 other libraries as PHP client but none of them work properly
You can use any HTTP transport mechanism. Even file_get_contents() will get API data. I personally would use cURL, but it’s not available on all servers.
@bcworkz
I wrote the code using cURL, But I have problem with uploading files and also authentication, Could you please give me a proper sample for that?
is it need to install a plugin for authentication or it can be done without any plugin?
I worked with XML-RPC before and it works without any plugin for authentication
Also I checked this library:
https://github.com/WP-API/client-php
It seems that it written by API team but there isn’t any documentation about how to use and methods
Yeah, REST and RPC are entirely unrelated. You can get some information from the API without authentication, but posting data certainly requires authentication. The default cookie authentication will not work for remote server access, so yes, you must use an authentication plugin.
I’m sorry, I don’t have any functional examples that fit your situation. In particular where file uploads are involved. Maybe I’m missing something, but I’m not aware of any upload functionality in the default API. I suppose the API could be extended to allow for uploads, but I’m not sure how that would work. I barely know how conventional uploads work from a browser.