错误415不支持使用IBM Cloud文档翻译提供的内容类型

问题描述

$auth = base64_encode( 'apikey:' . $apikey );
$endpoint          = $url . '/v3/documents?version=2018-05-01';
$filename          = ABSPATH.'wp-content/uploads/sample.pdf';
$filetype = wp_check_filetype('sample.pdf');
$response=wp_remote_post(
    $endpoint,array(
            'body'    => array(
                         'file' => '@' .$filename,'source' => $source_lang,'target' => $target_lang,),"headers"  => array(
        'Authorization' => 'Basic ' . $auth,'content-type' => $filetype['type'],)
    )
);

print_r($response);

它给出错误:415 {\ n“代码”:415,\ n“错误”:“不支持提供的内容类型。” \ n}“如何解决该问题

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)