deepl-php-lib icon indicating copy to clipboard operation
deepl-php-lib copied to clipboard

Reproduce Client Bug

Open MolloKhan opened this issue 2 years ago • 0 comments

Reproducer of #43

If you reset the $curl instance right before handling the response the error goes away

// BabyMarkt\DeepL\Client

    public function request($url, $body = '', $method = 'POST')
    {
        ...

        if ($this->curl && is_resource($this->curl)) {
            curl_close($this->curl);
        }

        $this->curl = curl_init();
        curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);

        return $this->handleResponse($response, $httpCode);
    }

MolloKhan avatar May 20 '22 16:05 MolloKhan