From f9cca293cd4b878e1f463dad8d090588cf6f6831 Mon Sep 17 00:00:00 2001 From: Leonid Sheikman Date: Fri, 4 Feb 2022 21:11:24 +0300 Subject: [PATCH] add automatic resend request --- src/WbApiClient.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/WbApiClient.php b/src/WbApiClient.php index d563e5a..2acd6ef 100644 --- a/src/WbApiClient.php +++ b/src/WbApiClient.php @@ -189,7 +189,6 @@ protected function sendRequest( string $path, string $method = 'GET', array $dat if ( empty( $this->token ) ) { return $this->handleError( 'The Token is not specified' ); } - if ( !isset( $data['dateFrom'] ) ) { return $this->handleError( 'The dateFrom parameter is not specified' ); } @@ -245,7 +244,7 @@ protected function sendRequest( string $path, string $method = 'GET', array $dat $curlErrors = curl_error( $this->curl ); $curlInfo = curl_getinfo( $this->curl ); - $ip = $curlInfo['primary_ip']; + $ipAddress = $curlInfo['primary_ip']; $header_size = $curlInfo['header_size']; $headerCode = $curlInfo['http_code']; $responseHeaders = trim( substr( $response, 0, $header_size ) ); @@ -272,7 +271,7 @@ protected function sendRequest( string $path, string $method = 'GET', array $dat $retval->data = $responseBody; $retval->http_code = $headerCode; $retval->headers = $responseHeaders; - $retval->ip = $ip; + $retval->ip = $ipAddress; $retval->curlErrors = $curlErrors; $retval->method = $method . ':' . $url; $retval->timestamp = date( DATE_RFC3339 );