我最近将狂饮版本从3更新到了6。以下调用在3上有效,但是现在我需要将其升级到6(因为它不起作用)。阅读文档后,我对这个新的职位要求在Guzzle 6中的工作方式感到有些困惑。这是我与Guzzle 3一起使用的旧职位要求]
try { $request = $this->guzzleClient->post( '/login?token='.$this->container->getParameter("token"), array(), json_encode($data) ); $request->setHeader('Content-Type', 'application/json'); $response = $request->send(); return $response->json(); }
我该如何处理它以便发布请求?
我最近将狂饮版本从3更新到了6。以下调用在3上有效,但是现在我需要将其升级到6(因为它不起作用)。阅读文档后,我有点困惑如何...
您需要这个: