/**
  * Creates a ServiceBusRestProxy with specified parameter. 
  * 
  * @param IHttpClient $channel        The channel to communicate. 
  * @param string      $uri            The URI of Service Bus service.
  * @param ISerializer $dataSerializer The serializer of the Service Bus.
  *
  * @return none
  */
 public function __construct($channel, $uri, $dataSerializer)
 {
     parent::__construct($channel, $uri, Resources::EMPTY_STRING, $dataSerializer);
 }
 /**
  * Sends HTTP request with the specified parameters.
  *
  * @param string $method         HTTP method used in the request
  * @param array  $headers        HTTP headers.
  * @param array  $queryParams    URL query parameters.
  * @param array  $postParameters The HTTP POST parameters.
  * @param string $path           URL path
  * @param int    $statusCode     Expected status code received in the response
  * @param string $body           Request body
  *
  * @return \HTTP_Request2_Response
  */
 protected function send($method, $headers, $queryParams, $postParameters, $path, $statusCode, $body = Resources::EMPTY_STRING)
 {
     // Add redirect to expected results
     if (!is_array($statusCode)) {
         $statusCode = array($statusCode);
     }
     array_push($statusCode, Resources::STATUS_MOVED_PERMANENTLY);
     $response = parent::send($method, $headers, $queryParams, $postParameters, $path, $statusCode, $body);
     // Set new URI endpoint if we get redirect response and perform query
     if ($response->getStatus() == Resources::STATUS_MOVED_PERMANENTLY) {
         $this->setUri($response->getHeader('location'));
         array_pop($statusCode);
         $response = parent::send($method, $headers, $queryParams, $postParameters, $path, $statusCode, $body);
     }
     return $response;
 }
 /** 
  * Creates a WrapRestProxy with specified parameters. 
  * 
  * @param IHttpClient $channel The channel to send the WRAP request. 
  * @param string      $uri     The Uri of the WRAP service. 
  * 
  * @return none
  */
 public function __construct($channel, $uri)
 {
     parent::__construct($channel, $uri, Resources::EMPTY_STRING, null);
 }
Example #4
0
 /**
  * Initializes new OAuthRestProxy object.
  *
  * @param IHttpClient $channel The HTTP client used to send HTTP requests.
  * @param string      $uri     The storage account uri.
  */
 public function __construct($channel, $uri)
 {
     parent::__construct($channel, $uri, Resources::EMPTY_STRING, new JsonSerializer());
 }
 /**
  * Initializes new TableRestProxy object.
  * 
  * @param IHttpClient       $channel        The HTTP client channel.
  * @param string            $uri            The storage account uri.
  * @param IAtomReaderWriter $atomSerializer The atom serializer.
  * @param IMimeReaderWriter $mimeSerializer The MIME serializer.
  * @param ISerializable     $dataSerializer The data serializer.
  */
 public function __construct($channel, $uri, $atomSerializer, $mimeSerializer, $dataSerializer)
 {
     parent::__construct($channel, $uri, Resources::EMPTY_STRING, $dataSerializer);
     $this->_atomSerializer = $atomSerializer;
     $this->_mimeSerializer = $mimeSerializer;
 }