Skip to content

Commit

Permalink
add automatic resend request
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid74 committed Feb 4, 2022
1 parent 4b2e784 commit f9cca29
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/WbApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
Expand Down Expand Up @@ -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 ) );
Expand All @@ -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 );
Expand Down

0 comments on commit f9cca29

Please sign in to comment.