Must explain. Early with curl was:
$html_body_args[‘type’] = ‘ZIP’;
$html_body_args[‘invoiceFile’] = curl_file_create(WP_CONTENT_DIR . ‘/uploads/exported_html_files/’.$post_ids_str.’-html.zip’, ‘application/zip’, $post_ids_str.’-html.zip’);
$html_curl_args[CURLOPT_POSTFIELDS] = $html_body_args;
curl_setopt_array($html_curl, $html_curl_args);
and API gave a successful answer.
Now I rewrite code: ($html_curl_args it is array with header (code above in topic question) and with parameters in this code)
$html_curl_args[‘body’] = $html_body_args;
wp_remote_request( $html_url, $html_curl_args );
And API send me [body] => {“code”:400,”message”:”HTTP 400 Bad Request”}. Where is my mistake?