code: private function calculateStringToSignV2(array $parameters, $queuepath = null)
      {
  
          $parsedUrl = parse_url($this->config['ServiceURL']);
          $endpoint = $parsedUrl['host'];
          if (isset($parsedUrl['port']) && !is_null($parsedUrl['port'])) {
              $endpoint .= ':' . $parsedUrl['port'];
          }
  
          $data = 'POST';
          $data .= "\n";
          $data .= $endpoint;
          $data .= "\n";
          if ($queuepath) {
              $uri = $queuepath;
          } else {
              $uri = "/";
          }
          $uriencoded = implode("/", array_map(array($this, "urlencode"), explode("/", $uri)));
          $data .= $uriencoded;
          $data .= "\n";
          uksort($parameters, 'strcmp');
          $data .= $this->getParametersAsString($parameters);
  
          return $data;
      }
docs: Calculate String to Sign for SignatureVersion 2
  @param array $parameters request parameters
  @param null $queuepath
  @return String to Sign