Kubernetes更改内容类型

时间:2016-08-02 09:25:59

标签: php kubernetes content-type silex guzzle

我有一个PHP服务。 一个端点调用这些服务中的其他端点。 为了连接我使用guzzle。 从第一个端点发送到第二个端点的内容应该是application / json。 在docker上它可以正常工作但是当我部署到Kubernetes时, 在日志中我看到请求内容是application / x-www-form-urlencoded。 即使内容类型是硬编码的:

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
        )
    );
}

有人知道为什么会这样吗?

1 个答案:

答案 0 :(得分:0)

问题是针对php 7的Dynatrace监控。 新版插件停止剪切标题。

相关问题