Support » Plugins » Communicating the WordPress way with server API

  • Resolved



    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 and and an installation so that unserialize can work.

    Tracing the code and displaying the results I got from the 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.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Communicating the WordPress way with server API’ is closed to new replies.