当前位置: 首页>>代码示例>>PHP>>正文


PHP Facebook::request方法代码示例

本文整理汇总了PHP中Facebook\Facebook::request方法的典型用法代码示例。如果您正苦于以下问题:PHP Facebook::request方法的具体用法?PHP Facebook::request怎么用?PHP Facebook::request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Facebook\Facebook的用法示例。


在下文中一共展示了Facebook::request方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPageDataFromFacebook

 /**
  * Call Facebook API and fetch page data
  *
  * @param Facebook ID of the page 	$page_id
  * @param Database Access token 	$access_token
  *
  * @return GraphPage
  */
 public function getPageDataFromFacebook($page_id, $access_token)
 {
     $params = array('fields' => 'access_token, picture.width(140).height(140){url}, hometown, about, bio, band_members, artists_we_like, booking_agent, website');
     $request = $this->facebook->request('GET', '/' . $page_id, $params, $access_token);
     try {
         $response = $this->facebook->getClient()->sendRequest($request);
     } catch (Exception $e) {
         dd($e);
     }
     return $response->getGraphPage();
 }
开发者ID:VickoFranic,项目名称:gigspy,代码行数:19,代码来源:FacebookHelper.php

示例2: testCreatingANewRequestWillDefaultToTheProperConfig

 public function testCreatingANewRequestWillDefaultToTheProperConfig()
 {
     $config = array_merge($this->config, ['default_access_token' => 'foo_token', 'enable_beta_mode' => true, 'default_graph_version' => 'v1337']);
     $fb = new Facebook($config);
     $request = $fb->request('FOO_VERB', '/foo');
     $this->assertEquals('1337', $request->getApp()->getId());
     $this->assertEquals('foo_secret', $request->getApp()->getSecret());
     $this->assertEquals('foo_token', (string) $request->getAccessToken());
     $this->assertEquals('v1337', $request->getGraphVersion());
     $this->assertEquals(FacebookClient::BASE_GRAPH_URL_BETA, $fb->getClient()->getBaseGraphUrl());
 }
开发者ID:shubhamvadhera,项目名称:cmpe272-teamproject,代码行数:11,代码来源:FacebookTest.php

示例3: testCreatingANewRequestWillDefaultToTheProperConfig

 public function testCreatingANewRequestWillDefaultToTheProperConfig()
 {
     $config = array_merge($this->config, ['default_access_token' => 'foo_token', 'http_client_handler' => new FooClientInterface(), 'persistent_data_handler' => new FooPersistentDataInterface(), 'enable_beta_mode' => true, 'default_graph_version' => 'v1337']);
     $fb = new Facebook($config);
     $request = $fb->request('FOO_VERB', '/foo');
     $this->assertInstanceOf('Facebook\\Tests\\FooClientInterface', $fb->getClient()->getHttpClientHandler());
     $this->assertInstanceOf('Facebook\\Tests\\FooPersistentDataInterface', $fb->getRedirectLoginHelper()->getPersistentDataHandler());
     $this->assertEquals(FacebookClient::BASE_GRAPH_URL_BETA, $fb->getClient()->getBaseGraphUrl());
     $this->assertEquals('1337', $request->getApp()->getId());
     $this->assertEquals('foo_secret', $request->getApp()->getSecret());
     $this->assertEquals('foo_token', (string) $request->getAccessToken());
     $this->assertEquals('v1337', $request->getGraphVersion());
 }
开发者ID:ben12345,项目名称:SchoolManager,代码行数:13,代码来源:FacebookTest.php


注:本文中的Facebook\Facebook::request方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。