← All changes
|
includes/requests/class-hostinger-requests-client.php
+7
-3
2.0.1
→
2.1.1
View file →
| @@ -17,9 +17,9 @@ | ||
| 17 | 17 | $url = $this->api_url . $endpoint; |
| 18 | 18 | $request_args = array( |
| 19 | 19 | 'method' => 'GET', |
| 20 | 20 | 'headers' => array_merge( $this->default_headers, $headers ), |
| 21 | - 'timeout' => $timeout | |
| 21 | + 'timeout' => $timeout, | |
| 22 | 22 | ); |
| 23 | 23 | |
| 24 | 24 | if ( ! empty( $params ) ) { |
| 25 | 25 | $url = add_query_arg( $params, $url ); |
| @@ -24,9 +24,11 @@ | ||
| 24 | 24 | if ( ! empty( $params ) ) { |
| 25 | 25 | $url = add_query_arg( $params, $url ); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - return wp_remote_get( $url, $request_args ); | |
| 28 | + $response = wp_remote_get( $url, $request_args ); | |
| 29 | + | |
| 30 | + return $response; | |
| 29 | 31 | } |
| 30 | 32 | |
| 31 | 33 | public function post( $endpoint, $params = array(), $headers = array(), $timeout = 120 ) { |
| 32 | 34 | $url = $this->api_url . $endpoint; |
| @@ -36,7 +38,9 @@ | ||
| 36 | 38 | 'headers' => array_merge( $this->default_headers, $headers ), |
| 37 | 39 | 'body' => $params, |
| 38 | 40 | ); |
| 39 | 41 | |
| 40 | - return wp_remote_post( $url, $request_args ); | |
| 42 | + $response = wp_remote_post( $url, $request_args ); | |
| 43 | + | |
| 44 | + return $response; | |
| 41 | 45 | } |
| 42 | 46 | } |