Skip to content

Commit 8ea267b

Browse files
committed
All $this->httpClient->post replaced with $this->httpClient->request
1 parent 2827bc8 commit 8ea267b

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

src/Message/CreateMicroOrderRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public function setAuthCode($authCode)
7777
*/
7878
public function sendData($data)
7979
{
80-
$request = $this->httpClient->post($this->endpoint)->setBody(Helper::array2xml($data));
81-
$response = $request->send()->getBody();
80+
$request = $this->httpClient->request('POST', $this->endpoint, [], Helper::array2xml($data));
81+
$response = $request->getBody();
8282
$responseData = Helper::xml2array($response);
8383

8484
return $this->response = new CreateOrderResponse($this, $responseData);

src/Message/QueryOpenIdByAuthCodeRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function setAuthCode($authCode)
7171
*/
7272
public function sendData($data)
7373
{
74-
$request = $this->httpClient->post($this->endpoint)->setBody(Helper::array2xml($data));
75-
$response = $request->send()->getBody();
74+
$request = $this->httpClient->request('POST', $this->endpoint, [], Helper::array2xml($data));
75+
$response = $request->getBody();
7676
$responseData = Helper::xml2array($response);
7777

7878
return $this->response = new CloseOrderResponse($this, $responseData);

src/Message/QueryRefundRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function setRefundId($refundId)
153153
*/
154154
public function sendData($data)
155155
{
156-
$request = $this->httpClient->request('post', $this->endpoint, [], Helper::array2xml($data));
156+
$request = $this->httpClient->request('POST', $this->endpoint, [], Helper::array2xml($data));
157157
$response = $request->getBody();
158158
$responseData = Helper::xml2array($response);
159159

src/Message/QueryTransferRequest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ public function sendData($data)
116116
);
117117

118118
$body = Helper::array2xml($data);
119-
$request = $this->httpClient->post($this->endpoint, null, $data)->setBody($body);
120-
$request->getCurlOptions()->overwriteWith($options);
121-
$response = $request->send()->getBody();
119+
$request = $this->httpClient->request('POST', $this->endpoint, $options, $body);
120+
$response = $request->getBody();
122121
$responseData = Helper::xml2array($response);
123122

124123
return $this->response = new QueryTransferResponse($this, $responseData);

src/Message/ShortenUrlRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function setLongUrl($longUrl)
7171
*/
7272
public function sendData($data)
7373
{
74-
$request = $this->httpClient->post($this->endpoint)->setBody(Helper::array2xml($data));
75-
$response = $request->send()->getBody();
74+
$request = $this->httpClient->request('POST', $this->endpoint, [], Helper::array2xml($data));
75+
$response = $request->getBody();
7676
$responseData = Helper::xml2array($response);
7777

7878
return $this->response = new ShortenUrlResponse($this, $responseData);

0 commit comments

Comments
 (0)