Created
September 14, 2017 22:04
-
-
Save mnelson4/e781891b63e077f43826e91ddf46205f to your computer and use it in GitHub Desktop.
Code using the WP HTTP API to post to the EE4 REST API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$response = wp_remote_request( | |
'http://src.wordpress-develop.dev/wp-json/ee/v4.8.36/answers', | |
array( | |
'method' => 'POST', | |
'headers' => array( | |
'Authorization' => 'Basic ' . base64_encode( YOUR_USERNAME . ':' . YOUR_PASSWORD ), | |
), | |
'body' => array( | |
'REG_ID' =>1, | |
'QST_ID' => 10, | |
'ANS_value' => 'Alderan' | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment