Kubernetes changes content type

8/2/2016

I have a service in PHP. One endpoint calls to other endpoint in these service. For connection I use guzzle. Content sent from 1st endpoint to 2nd should be application/json. On docker it works correctly but when I deploy to Kubernetes, in logs I see that request content is application/x-www-form-urlencoded. Even if content type is hardcoded:

private function getPostRequestOptions($postData) : array
{
    return [
        'headers' => [
            'Content-Type' => 'application/json',
            'Request-ID' => $this->requestId
        ],
        'body' => json_encode($postData),
        'connect_timeout' => static::CONNECT_TIMEOUT,
        'timeout' => static::TIMEOUT,
        'http_errors' => true,
    ];
}

public function sendPost(string $path, $postData): \stdClass
{
    return $this->executeRequest(
        'POST',
        $this->getFullUrl($path),
        $this->getPostRequestOptions(
            $postData
        )
    );
}

Does someone have any clue why it happens like this?

-- gzres
content-type
guzzle
kubernetes
php
silex

1 Answer

8/19/2016

The problem was Dynatrace monitoring for php 7. New version of plugin stopped cutting headers.

-- gzres
Source: StackOverflow