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


PHP HttpSocket::delete方法代码示例

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


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

示例1: request_delete

 public function request_delete($id)
 {
     $link = Router::url('/', true) . 'rest_posts/' . $id . '.json';
     $data = null;
     $httpSocket = new HttpSocket();
     $response = $httpSocket->delete($link, $data);
     $this->set('response_code', $response->code);
     $this->set('response_body', $response->body);
     $this->render('/Client/request_response');
 }
开发者ID:trice4,项目名称:BlogTest,代码行数:10,代码来源:ClientController.php

示例2: request_delete

 public function request_delete($id)
 {
     // remotely post the information to the server
     $link = "http://" . $_SERVER['HTTP_HOST'] . $this->webroot . 'rest_tasks/' . $id . '.json';
     $data = null;
     $httpSocket = new HttpSocket();
     $response = $httpSocket->delete($link, $data);
     $this->set('response_code', $response->code);
     $this->set('response_body', $response->body);
     $this->render('/Client/request_response');
 }
开发者ID:rodrigopluz,项目名称:provaTecnica-BDR,代码行数:11,代码来源:ClientController.php

示例3: sendRequest

 /**
  * HTTP上で要求の送信
  * @param string $url
  * @param array $data
  * @param string $type
  */
 private function sendRequest($url, $data, $type = 'post')
 {
     $http = new HttpSocket();
     if ($type == 'post') {
         $response = $http->post($url, $data);
     } else {
         if ($type == 'get') {
             $response = $http->get($url, $data);
         } elseif ($type == 'delete') {
             $response = $http->delete($url, $data);
         }
     }
     return json_decode($response->body);
 }
开发者ID:john-saman,项目名称:YotpoAPIComponent,代码行数:20,代码来源:YotpoAPIComponent.php

示例4: delete

 public function delete($id)
 {
     // remotely post the information to the server
     $link = "http://" . $_SERVER['HTTP_HOST'] . $this->webroot . 'posts/' . $id . '.json';
     $data = null;
     $httpSocket = new HttpSocket();
     // $data['Post']['title']="this is updated title";
     //$data['Post']['content']="this is updated content";
     $response = $httpSocket->delete($link, $data);
     $this->set('response_code', $response->code);
     $this->set('response_body', $response->body);
     $this->set('link', $link);
     $this->render('/client/request_response');
 }
开发者ID:ashwiniks,项目名称:cookbookexp,代码行数:14,代码来源:ClientController.php

示例5: deleteEventFromServer

 /**
  * Deletes the event and the associated Attributes from another Server
  * TODO move this to a component
  *
  * @return bool true if success, error message if failed
  */
 public function deleteEventFromServer($uuid, $server, $HttpSocket = null)
 {
     // TODO private and delete(?)
     $url = $server['Server']['url'];
     $authkey = $server['Server']['authkey'];
     if (null == $HttpSocket) {
         App::uses('HttpSocket', 'Network/Http');
         $HttpSocket = new HttpSocket();
     }
     $request = array('header' => array('Authorization' => $authkey, 'Accept' => 'application/xml', 'Content-Type' => 'application/xml'));
     $uri = $url . '/events/0?uuid=' . $uuid;
     // LATER validate HTTPS SSL certificate
     $this->Dns = ClassRegistry::init('Dns');
     if ($this->Dns->testipaddress(parse_url($uri, PHP_URL_HOST))) {
         // TODO NETWORK for now do not know how to catch the following..
         // TODO NETWORK No route to host
         $response = $HttpSocket->delete($uri, array(), $request);
         // TODO REST, DELETE, some responce needed
     }
 }
开发者ID:HardlyHaki,项目名称:MISP,代码行数:26,代码来源:Event.php

示例6: delete

 /**
  * Make a delete request to the api
  * @param  string $url  relative to the base
  * @param  array $data 
  * @return array
  */
 public function delete($url, $data = array())
 {
     $http = new HttpSocket();
     return $this->process($http->delete($this->apiBase . $url . '?' . http_build_query($this->_params($data))));
 }
开发者ID:sujeshkumaruv,项目名称:CakePHP-Instagram-Component,代码行数:11,代码来源:InstagramComponent.php


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