@@ 79-97 (lines=19) @@ | ||
76 | /** |
|
77 | * {@InheritDoc} |
|
78 | */ |
|
79 | public function send(Request $request) |
|
80 | { |
|
81 | $guzzleRequest = $this->client->createRequest( |
|
82 | $request->getMethod(), |
|
83 | $request->getUri(), |
|
84 | $request->getHeaders(), |
|
85 | $request->getBody() |
|
86 | ); |
|
87 | ||
88 | $guzzleResponse = $guzzleRequest->send(); |
|
89 | ||
90 | $response = new Response( |
|
91 | $guzzleResponse->getStatusCode(), |
|
92 | $guzzleResponse->getHeaders()->toArray(), |
|
93 | $guzzleResponse->getBody(true) |
|
94 | ); |
|
95 | ||
96 | return $response; |
|
97 | } |
|
98 | ||
99 | /** |
|
100 | * use to mock client |
@@ 84-105 (lines=22) @@ | ||
81 | /** |
|
82 | * {@InheritDoc} |
|
83 | */ |
|
84 | public function send(Request $request) |
|
85 | { |
|
86 | $guzzleRequest = $this->client->createRequest( |
|
87 | $request->getMethod(), |
|
88 | $request->getUri(), |
|
89 | ['headers' => $request->getHeaders()] |
|
90 | ); |
|
91 | ||
92 | $guzzleRequest->setBody(Stream::factory($request->getBody())); |
|
93 | ||
94 | $guzzleResponse = $this->getClient()->send($guzzleRequest); |
|
95 | ||
96 | $response = new Response( |
|
97 | $guzzleResponse->getStatusCode(), |
|
98 | $guzzleResponse->getHeaders(), |
|
99 | $guzzleResponse->getBody(true) |
|
100 | ); |
|
101 | ||
102 | return $response; |
|
103 | } |
|
104 | ||
105 | /** |
|
106 | * Used to mock client |
|
107 | * |
|
108 | * @return \GuzzleHttp\Event\Emitter|\GuzzleHttp\Event\EmitterInterface |