Development environment
wsl swoole2.1.3
Interface error
there is no problem when using the previous code to call the interface
using swoole asynchronous http often causes the interface to report an error
The proxy server received an invalid response from an upstream server.
Local error
Local errors are often reported
WARNING swConnection_sendfile (ERROR 505): length or offset is invalid.
the code is as follows
$cli = new \Swoole\Coroutine\Http\Client($ip, $port, $ssl);
$cli->set(["timeout" => 1]);
$cli->setHeaders(["Host" => $host]);
$cli->addFile($mergreImg, "merge_file");
$cli->addFile($templateImg, "template_file");
$cli->post("/imagepp/v1/mergeface", [
"api_key" => $this->api_key,
"api_secret" => $this->api_secret,
"template_rectangle" => $templateRect,
"merge_rate" => $this->merge_rate,
]);
$cli->close();