وردپرس

Rest Api failed to publish 15k character word post content


this is working fine:

$json_data = [
'title' => $post->title,
'content' => $post->title,
'status' => 'draft',
];   
 $response = $client->request('POST', "/wp-json/wp/v2/posts", [
        'json' => $json_data,
        'headers' => [
            'Authorization' => 'Basic ' . base64_encode($username . ':' . $application_password),
        ],
    ]);

    return "working fine"

but this code failed when i put post content as 15k character lentgh

  $json_data = [
'title' => $post->title,
'content' => $post->content,
'status' => 'draft',
];
  $response = $client->request('POST', "/wp-json/wp/v2/posts", [
        'json' => $json_data,
        'headers' => [
            'Authorization' => 'Basic ' . base64_encode($username . ':' . $application_password),
        ],
    ]);

  return "not worked"

Showing the issue is

Server error: POST https://example.com/wp-json/wp/v2/posts resulted in a 500 Internal Server Error response: {"code":"db_insert_error","message":"Could not insert post into the database.","data":{"status":500},"additional_data":[ (truncated...)

  • This topic was modified 2 minutes ago by imranbru99.

The page I need help with: [log in to see the link]

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا