protected function _getMultipartRequestFromParams($method_template, $border, $params)
  {
    $request = '';
    foreach ($params as $key => $value) {
      // is it an array?
      if (is_array($value)) {
        throw new CodebirdMediaException('Using URL-encoded parameters is not supported for uploading media.');
      }
      $request .=
        '--' . $border . "\r\n"
        . 'Content-Disposition: form-data; name="' . $key . '"';

      // check for filenames
      $data = $this->_checkForFiles($method_template, $key, $value);
      if ($data !== false) {
        $value = $data;
      }

      $request .= "\r\n\r\n" . $value . "\r\n";
    }

    return $request;
  }
protected function _getMultipartRequestFromParams($method_template, $border, $params)
  {
    $request = '';
    foreach ($params as $key => $value) {
      // is it an array?
      if (is_array($value)) {
        throw new CodebirdMediaException('Using URL-encoded parameters is not supported for uploading media.');
      }
      $request .=
        '--' . $border . "\r\n"
        . 'Content-Disposition: form-data; name="' . $key . '"';

      // check for filenames
      $data = $this->_checkForFiles($method_template, $key, $value);
      if ($data !== false) {
        $value = $data;
      }

      $request .= "\r\n\r\n" . $value . "\r\n";
    }

    return $request;
  }
protected function _getMultipartRequestFromParams ( $ method_template , $ border , $ params ) { $ request = '' ; foreach ( $ params as $ key => $ value ) { // is it an array? if ( is_array ( $ value ) ) { throw new CodebirdMediaException ( 'Using URL-encoded parameters is not supported for uploading media.' ) ; } $ request .= '--' . $ border . "\r\n" . 'Content-Disposition: form-data; name="' . $ key . '"' ; // check for filenames $ data = $ this -> _checkForFiles ( $ method_template , $ key , $ value ) ; if ( $ data !== false ) { $ value = $ data ; } $ request .= "\r\n\r\n" . $ value . "\r\n" ; } return $ request ; }
Merge multipart string from parameters array

@param string $method_template The method template to call
@param string $border          The multipart border
@param array  $params          The parameters to send along

@return string request
@throws \Exception
Merge multipart string from parameters array