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