post($url, [ 'headers' => $headers, 'json' => $data, ]); $statusCode = $response->getStatusCode(); $getBody = $response->getBody()->getContents(); Log::info("HttpHandler - 请求结果:statusCode==".$statusCode." getBody==".$getBody); return ['code'=>$statusCode, 'message'=>'', 'data'=>$getBody]; } catch (GuzzleException $e) { Log::error("HttpHandler - 请求异常 - guzzle: " . $e->getMessage()); return ['code'=>500, 'message'=>$e->getMessage()]; } catch (\Exception $exception) { Log::error("HttpHandler - 请求异常 - exception: " . $exception->getMessage()); return ['code'=>500, 'message'=>$exception->getMessage()]; } } }