Communicating the WordPress way with server API
-
Hi!
I want to create my own API and communicate with my server from a plugin. I want to do it “the WordPress way” (like it’s done when an installation calls for plugin information for example).
My problem is that when I use :
$request = wp_remote_post( ... ); $res = unserialize(wp_remote_retrieve_body($request));
… I always end up with ‘false’ instead of my unserialized data. The thing is that I send data with accents (à, é, ?, …).
I would like to know how does WordPress sends the data between api.www.ads-software.com and and an installation so that unserialize can work.
Tracing the code and displaying the results I got from the api.www.ads-software.com showed that ‘é’ can be received as é and something like ?Z.
What functions/parsing method should I use to send my data so that the unserialize works ?
Thank you.
P.S. I already tried utf8_encode, mb_* but ended up with nothing working yet.
- The topic ‘Communicating the WordPress way with server API’ is closed to new replies.