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