當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Http::jsonPost方法代碼示例

本文整理匯總了PHP中Http::jsonPost方法的典型用法代碼示例。如果您正苦於以下問題:PHP Http::jsonPost方法的具體用法?PHP Http::jsonPost怎麽用?PHP Http::jsonPost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Http的用法示例。


在下文中一共展示了Http::jsonPost方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: set

 /**
  * 設置菜單.
  *
  * @return bool
  */
 public function set($menus)
 {
     if ($menus instanceof Closure) {
         $menus = $menus($this);
     }
     if (!is_array($menus)) {
         throw new Exception('子菜單必須是數組或者匿名函數返回數組', 1);
     }
     $menus = $this->extractMenus($menus);
     $this->http->jsonPost(self::API_CREATE, ['button' => $menus]);
     return true;
 }
開發者ID:nlmayday,項目名稱:wechat,代碼行數:17,代碼來源:Menu.php

示例2: to

 /**
  * 發送消息
  *
  * @param string $openId
  *
  * @return bool
  */
 public function to($openId)
 {
     if (empty($this->message)) {
         throw new Exception('未設置要發送的消息');
     }
     $this->message->to = $openId;
     return $this->http->jsonPost(self::API_MESSAGE_SEND, $this->message->buildForStaff());
 }
開發者ID:stingbo,項目名稱:masapi,代碼行數:15,代碼來源:Staff.php

示例3: create

 /**
  * 創建二維碼
  *
  * @param string $actionName
  * @param array  $actionInfo
  * @param bool   $temporary
  * @param int    $expireSeconds
  *
  * @return Collection
  */
 protected function create($actionName, $actionInfo, $temporary = true, $expireSeconds = null)
 {
     $expireSeconds !== null || ($expireSeconds = 7 * self::DAY);
     $params = array('action_name' => $actionName, 'action_info' => array('scene' => $actionInfo));
     if ($temporary) {
         $params['expire_seconds'] = min($expireSeconds, 7 * self::DAY);
     }
     return new Collection($this->http->jsonPost(self::API_CREATE, $params));
 }
開發者ID:stingbo,項目名稱:masapi,代碼行數:19,代碼來源:QRCode.php

示例4: totag

 /**
  * 發送消息
  *
  * @param string $openId
  *
  * @return bool
  */
 public function totag($tagid, $agentid = 1)
 {
     if (empty($this->message)) {
         throw new Exception('未設置要發送的消息');
     }
     $this->message->totag = $tagid;
     $this->message->agentid = $agentid;
     $message_body = $this->message->buildForStaff();
     return $this->http->jsonPost(self::API_MESSAGE_SEND, $message_body);
 }
開發者ID:shoaly,項目名稱:wechat-biz,代碼行數:17,代碼來源:StaffBiz.php

示例5: send

 /**
  * @param string $to
  * @param string $templateId
  * @param array  $data
  * @param string $url
  * @param string $color
  *
  * @return int
  */
 public function send($to = null, $templateId = null, array $data = array(), $url = null, $color = '#FF0000')
 {
     $params = array('touser' => $to, 'template_id' => $templateId, 'url' => $url, 'topcolor' => $color, 'data' => $data);
     foreach ($params as $key => $value) {
         if (empty($value) && empty($this->message[$key])) {
             throw new Exception("消息屬性 '{$key}' 不能為空!");
         }
         $params[$key] = empty($value) ? $this->message[$key] : $value;
     }
     $params['data'] = $this->formatData($params['data']);
     $result = $this->http->jsonPost(self::API_SEND_NOTICE, $params);
     return $result['msgid'];
 }
開發者ID:emilymwang8,項目名稱:ajk-broker,代碼行數:22,代碼來源:Notice.php

示例6: moveUsers

 /**
  * Batch move users to a group.
  *
  * @param array $openIds
  * @param int   $groupId
  *
  * @return bool
  */
 public function moveUsers(array $openIds, $groupId)
 {
     $params = ['openid_list' => $openIds, 'to_groupid' => $groupId];
     $this->http->jsonPost(self::API_MEMBER_BATCH_UPDATE, $params);
     return true;
 }
開發者ID:nlmayday,項目名稱:wechat,代碼行數:14,代碼來源:Group.php

示例7: short

 /**
  * 轉短鏈接
  *
  * @param string $url
  *
  * @return string
  */
 public function short($url)
 {
     $params = array('action' => 'long2short', 'long_url' => $url);
     $response = $this->http->jsonPost(self::API_SHORT_URL, $params);
     return $response['short_url'];
 }
開發者ID:IdealsSpace,項目名稱:wechat,代碼行數:13,代碼來源:Url.php

示例8: query

 /**
  * 查詢數據.
  *
  * @param string $api
  * @param string $from
  * @param string $to
  *
  * @return array
  */
 protected function query($api, $from, $to)
 {
     $params = ['begin_date' => $from, 'end_date' => $to];
     $result = $this->http->jsonPost($api, $params);
     return $result['list'];
 }
開發者ID:hexing-w,項目名稱:wechat,代碼行數:15,代碼來源:Stats.php

示例9: setmute

 /**
  * 設置成員新消息免打擾
  *
  * @param  array $user_mute_list 成員新消息免打擾參數,數組,最大支持10000個成員
  * @return array
  */
 public function setmute($user_mute_list)
 {
     $params = array('user_mute_list' => $user_mute_list);
     return $this->http->jsonPost(self::API_SETMUTE, $params);
 }
開發者ID:stoneworld,項目名稱:wechat,代碼行數:11,代碼來源:Chat.php

示例10: deleteTagUser

 /**
  * 刪除標簽成員
  * @param  int    $tagId     
  * @param  array  $userList  
  * @param  array  $partyList
  * @return array 
  */
 public function deleteTagUser($tagId, $userList, $partyList)
 {
     $params = array('tagid' => $tagId, 'userlist' => $userList, 'partylist' => $partyList);
     return $this->http->jsonPost(self::API_DELETE_USER, $params);
 }
開發者ID:stoneworld,項目名稱:wechat,代碼行數:12,代碼來源:Tag.php

示例11: delete

 /**
  * 刪除門店.
  *
  * @param int $storeId
  *
  * @return bool
  */
 public function delete($storeId)
 {
     $params = ['poi_id' => $storeId];
     return $this->http->jsonPost(self::API_DELETE, $params);
 }
開發者ID:shownomercy,項目名稱:wechat,代碼行數:12,代碼來源:Store.php

示例12: checkin

 /**
  * 在線值機
  *
  * <pre>
  * $data:
  * {
  *     "code": "198374613512",
  *     "card_id":"p1Pj9jr90_SQRaVqYI239Ka1erkI",
  *     "passenger_name": "乘客姓名",
  *     "class": "艙等",
  *     "seat": "座位號",
  *     "etkt_bnr": "電子客票號", "qrcode_data": "二維碼數據", "is_cancel ": false
  * }
  * </pre>
  *
  * @param string $cardId
  * @param array  $data
  *
  * @return bool
  */
 public function checkin($cardId, array $data)
 {
     $params = array_merge(array('card_id' => $cardId), $data);
     return $this->http->jsonPost(self::API_BOARDING_PASS_CHECKIN, $params);
 }
開發者ID:Gwill,項目名稱:wechat,代碼行數:25,代碼來源:Card.php

示例13: update

 /**
  * 更新部門
  * @param  string  $name     部門名稱
  * @param  integer $parentid 父親部門id
  * @param  integer $order    在父部門中的次序值
  * @param  integer $id       部門id (可以自動生成)
  * @return integer           部門id
  */
 public function update($id, $name, $parentid = 1, $order = null)
 {
     $params = array('name' => $name, 'parentid' => $parentid, 'order' => $order, 'id' => $id);
     return $this->http->jsonPost(self::API_UPDATE, $params);
 }
開發者ID:stoneworld,項目名稱:wechat,代碼行數:13,代碼來源:Group.php

示例14: lists

 /**
  * 獲取永久素材列表.
  *
  * example:
  *
  * {
  *   "total_count": TOTAL_COUNT,
  *   "item_count": ITEM_COUNT,
  *   "item": [{
  *             "media_id": MEDIA_ID,
  *             "name": NAME,
  *             "update_time": UPDATE_TIME
  *         },
  *         //可能會有多個素材
  *   ]
  * }
  *
  * @param string $type
  * @param int    $offset
  * @param int    $count
  *
  * @return array
  */
 public function lists($type, $offset = 0, $count = 20)
 {
     $params = ['type' => $type, 'offset' => intval($offset), 'count' => min(20, $count)];
     return $this->http->jsonPost(self::API_FOREVER_LIST, $params);
 }
開發者ID:hexing-w,項目名稱:wechat,代碼行數:28,代碼來源:Media.php

示例15: getGroup

 /**
  * Get user's group id.
  *
  * @param string $openId
  *
  * @return int
  */
 public function getGroup($openId)
 {
     $params = ['openid' => $openId];
     $response = $this->http->jsonPost(self::API_GROUP, $params);
     return $response['groupid'];
 }
開發者ID:nlmayday,項目名稱:wechat,代碼行數:13,代碼來源:Manager.php


注:本文中的Http::jsonPost方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。