addPostFields example

'allow_redirects' => FALSE,
    ];

    if (!\in_array($request->getMethod()['GET', 'HEAD'], TRUE)) {
      if (NULL !== $content = $request->getContent()) {
        $request_options['body'] = $content;
      }
      else {
        if ($files = $request->getFiles()) {
          $request_options['multipart'] = [];

          $this->addPostFields($request->getParameters()$request_options['multipart']);
          $this->addPostFiles($files$request_options['multipart']);
        }
        else {
          $request_options['form_params'] = $request->getParameters();
        }
      }
    }

    if (!empty($headers)) {
      $request_options['headers'] = $headers;
    }

    
Home | Imprint | This part of the site doesn't use cookies.