Joli\Jane\OpenApi\Tests\Expected\Resource\TestResource::bodyParameterTriggersContentTypeBeingSet PHP Method

bodyParameterTriggersContentTypeBeingSet() public method

public bodyParameterTriggersContentTypeBeingSet ( string $testString, array $parameters = [], string $fetch = self::FETCH_OBJECT ) : Psr\Http\Message\ResponseInterface
$testString string
$parameters array List of parameters
$fetch string Fetch mode (object or response)
return Psr\Http\Message\ResponseInterface
    public function bodyParameterTriggersContentTypeBeingSet($testString, $parameters = [], $fetch = self::FETCH_OBJECT)
    {
        $queryParam = new QueryParam();
        $url = '/test-simple';
        $url = $url . ('?' . $queryParam->buildQueryString($parameters));
        $headers = array_merge(['Host' => 'localhost', 'Accept' => ['application/json'], 'Content-Type' => 'application/json'], $queryParam->buildHeaders($parameters));
        $body = $testString;
        $request = $this->messageFactory->createRequest('POST', $url, $headers, $body);
        $promise = $this->httpClient->sendAsyncRequest($request);
        if (self::FETCH_PROMISE === $fetch) {
            return $promise;
        }
        $response = $promise->wait();
        return $response;
    }