original_string: public function send($method, $parameters = array(), $body = null)
      {
  
          $url = $this->endpoint;
          if (!empty($parameters)) {
              if (strpos($url, '?') === false) {
                  $sep = '?';
              } else {
                  $sep = '&';
              }
              foreach ($parameters as $name => $value) {
                  $url .= $sep . urlencode($name) . '=' . urlencode($value);
                  $sep = '&';
              }
          }
          if (!$this->unsigned) {
              $header = ToolProvider\ToolConsumer::addSignature($url, $this->consumer->getKey(), $this->consumer->secret, $body, $method, $this->mediaType);
          } else {
              $header = null;
          }
  
  // Connect to tool consumer
          $http = new HTTPMessage($url, $method, $body, $header);
  // Parse JSON response
          if ($http->send() && !empty($http->response)) {
              $http->responseJson = json_decode($http->response);
              $http->ok = !is_null($http->responseJson);
          }
  
          return $http;
  
      }
code: public function send($method, $parameters = array(), $body = null)
      {
  
          $url = $this->endpoint;
          if (!empty($parameters)) {
              if (strpos($url, '?') === false) {
                  $sep = '?';
              } else {
                  $sep = '&';
              }
              foreach ($parameters as $name => $value) {
                  $url .= $sep . urlencode($name) . '=' . urlencode($value);
                  $sep = '&';
              }
          }
          if (!$this->unsigned) {
              $header = ToolProvider\ToolConsumer::addSignature($url, $this->consumer->getKey(), $this->consumer->secret, $body, $method, $this->mediaType);
          } else {
              $header = null;
          }
  
  // Connect to tool consumer
          $http = new HTTPMessage($url, $method, $body, $header);
  // Parse JSON response
          if ($http->send() && !empty($http->response)) {
              $http->responseJson = json_decode($http->response);
              $http->ok = !is_null($http->responseJson);
          }
  
          return $http;
  
      }
code_tokens: public function send ( $ method , $ parameters = array ( ) , $ body = null ) { $ url = $ this -> endpoint ; if ( ! empty ( $ parameters ) ) { if ( strpos ( $ url , '?' ) === false ) { $ sep = '?' ; } else { $ sep = '&' ; } foreach ( $ parameters as $ name => $ value ) { $ url .= $ sep . urlencode ( $ name ) . '=' . urlencode ( $ value ) ; $ sep = '&' ; } } if ( ! $ this -> unsigned ) { $ header = ToolProvider \ ToolConsumer :: addSignature ( $ url , $ this -> consumer -> getKey ( ) , $ this -> consumer -> secret , $ body , $ method , $ this -> mediaType ) ; } else { $ header = null ; } // Connect to tool consumer $ http = new HTTPMessage ( $ url , $ method , $ body , $ header ) ; // Parse JSON response if ( $ http -> send ( ) && ! empty ( $ http -> response ) ) { $ http -> responseJson = json_decode ( $ http -> response ) ; $ http -> ok = ! is_null ( $ http -> responseJson ) ; } return $ http ; }
docstring: Send a service request.
  
  @param string  $method      The action type constant (optional, default is GET)
  @param array   $parameters  Query parameters to add to endpoint (optional, default is none)
  @param string  $body        Body of request (optional, default is null)
  
  @return HTTPMessage HTTP object containing request and response details
docstring_tokens: Send a service request .