我尝试在wordpress中从我的网站创建另一个网站的用户,但它不起作用:
$response = wp_remote_post('http://ip-server:8083/client-services/create', array(
'method' => 'PUT',
'timeout' => 45,
'redirection' => 5,
'httpversion' => '1.1',
'blocking' => true,
'headers' => array(),
'body' => array(
'idNumber' => '1062125775',
'idType' => 'CO3',
'firstName' => 'Peter',
'secondName' => 'Scott',
'lastName' => 'Blunt',
'secondLastName' => 'Jhonson',
'gender' => 'M',
'email' => 'petersc@yandex.com',
'birthday' => '636440400000',
'source' => 'app',
'user' => 'petersc',
'location' => array('city' => array('id' => '17616', 'name' => 'Albany', 'region' => array('id' => '45', 'name' => 'New york'))),
),
'cookies' => array() )
);
if ( is_wp_error( $response ) ) {
$error_message = $response->get_error_message();
echo "Something went wrong: $error_message";
} else {
echo 'Response:<pre>';
print_r( $response );
echo '</pre>';
}
当我在另一台服务器上使用post方法创建用户时,它就会发生..