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?
The problem was Dynatrace monitoring for php 7. New version of plugin stopped cutting headers.