Behind-the-scenes HTTP Request?

I’m trying to add a line to my functions.php that does a behind-the-scenes HTTP request submitting some user information to a mailing list URL I have. I’m trying to test the code at the moment, but nothing seems to be working.

I have tried the following:

Read More
$url = 'blabla.org/mailinglist/add?' . $user_email;
$request = new WP_Http;
$result = $request->request($url);

and

wp_remote_post($url);

Neither have worked. However, if I Just copy and paste the URL into my web browser, it works fine. Please help!

Thanks,

Tre

Related posts

Leave a Reply

2 comments

  1. Only use wp_remote_post() if you are actually posting something.

    Try using wp_remote_get() with a full url

    $url = 'http://blabla.org/mailinglist/add?' . $user_email;
    $results = wp_remote_get( $url );
    // var_dump( $results );