Title: wp_remote_post help
Last modified: August 21, 2016

---

# wp_remote_post help

 *  [xdecimos](https://wordpress.org/support/users/xdecimos/)
 * (@xdecimos)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/wp_remote_post-help/)
 * Hey guys
 * I know that it shouldn’t be as hard as it is but I can’t get it to work somehow.
   I know that it may be easy to fix but I just started to learn all of this and
   yeah. Gotta teach myself all of that.
    What I created so far is the link in order
   to retrieve the code. After that I’ve got to get a request from api.twitch.tv/
   kraken/oauth2/token but it doesn’t work somehow. What did I do wrong?
 *     ```
       <?php
   
       $usercode = $_GET['code'];
   
       $args = array(
       	'method' => 'POST',
       	'body' => 'client_id=91th8b4i2ouxdfn660xojhu1eqfaonu&client_secret=dqhzi4h2k2rnb67bzbno9kva43uwmf9&grant_type=authorization_code&redirect_uri=http://decimo.net/token.php&code=', $usercode);
   
       $answer = wp_remote_post('https://api.twitch.tv/kraken/oauth2/token', $args);
       if( is_wp_error( $answer ) ) {
          $error_message = $answer->get_error_message();
          echo "Something went wrong: $error_message";
       } else {
          echo 'Response:<pre>';
          print_r( $answer );
          echo '</pre>';
       }
       ?>
       ```
   
 * I just get a blank page. Is it maybe because I put the file [@root](https://wordpress.org/support/users/root/)
   of WP-folder?
 * Thanks a lot

The topic ‘wp_remote_post help’ is closed to new replies.

## Tags

 * [wp_remote_post](https://wordpress.org/support/topic-tag/wp_remote_post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [xdecimos](https://wordpress.org/support/users/xdecimos/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/wp_remote_post-help/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
