本文整理汇总了PHP中unknown::post方法的典型用法代码示例。如果您正苦于以下问题:PHP unknown::post方法的具体用法?PHP unknown::post怎么用?PHP unknown::post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unknown
的用法示例。
在下文中一共展示了unknown::post方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
/**
* undocumented function
*
* @param unknown $user
* @param unknown $pass
* @return void
* @access public
*/
function login($user = null, $password = null)
{
if (empty($user)) {
extract($this->config);
}
if (@empty($user) || @empty($password)) {
return trigger_error('Please specify a user / password for using this service');
}
$post = array('continue' => 'http://www.google.com/analytics/home/?et=reset&hl=en-US', 'service' => 'analytics', 'nui' => 'hidden', 'hl' => 'en-US', 'GA3T' => 'ouVrvynQwUs', 'Email' => $user, 'PersistentCookie' => 'yes', 'Passwd' => $password);
$response = $this->Http->post('https://www.google.com/accounts/ServiceLoginBoxAuth', $post);
if (!strpos($response, 'TokenAuth?continue')) {
return $this->connected = false;
}
$this->config['database'] = $user;
return $this->connected = true;
}
示例2: post
/**
*
* @return \Illuminate\Routing\Route
*/
public function post()
{
// $response = $this->client->post($this->endpoint, $this->getRequestVars());
// return new NvpResponse($result);
try {
// Grab the client's handler instance.
$clientHandler = $this->client->getConfig('handler');
// Create a middleware that echoes parts of the request.
$tapMiddleware = Middleware::tap(function ($request) {
print_r($request->getHeader('Content-Type'));
// application/json
echo $request->getBody() . "\n";
echo $request->getUri() . "\n";
// {"foo":"bar"}
});
$response = $this->client->post($this->endpoint, ['json' => $this->getRequestVars(), 'handler' => $tapMiddleware($clientHandler)]);
} catch (GuzzleHttp\Exception\BadResponseException $e) {
echo 'Uh oh! ' . $e->getMessage();
}
return $response;
}
示例3: addProfile
/**
* undocumented function
*
* @return void
* @access public
*/
function addProfile($profile)
{
if (!is_array($profile)) {
$profile = array('url' => $profile);
}
$profile = am(array('domain' => null, 'name' => null, 'account' => null, 'countryCode' => null, 'timeZone' => null, 'post' => array()), $profile);
$profile['account'] = $this->accountId($profile['account']);
if ($profile['domain']) {
$profile['domain'] = $this->profileId($profile['domain']);
}
if (is_string($profile['url'])) {
preg_match('/(http|https)+:\\/\\/(.+)/', $profile['url'], $match);
$profile['url'] = array('scheme' => $match[1], 'url' => $match[2]);
}
$post = am(array('aid' => 1101, 'vid' => 1151, 'rd' => 'vid=1100&scid=' . $profile['account'], 'usac_id' => null, 'ucpr_web_site_url' => null, 'uiti_id' => 293, 'uiti_id_orig' => 1, 'ubwe_new' => (int) (!$profile['domain']), 'ucpr_protocol' => $profile['url']['scheme'], 'ucpr_url' => $profile['url']['url'], 'uswe_id' => $profile['domain'], 'ucpr_name' => $profile['name'], 'ucpt_country_code' => $profile['countryCode'], 'tzCode' => $profile['timeZone']), $profile['post']);
$response = $this->Http->post('https://www.google.com/analytics/home/admin?scid=' . $profile['account'], $post);
if (!preg_match('/rid=([\\d]+)/', @$this->Http->response['header']['Location'], $match)) {
return false;
}
$this->listSources(true);
return (int) $match[1];
}