WordPress ajax error 400 bad request for sending data to remote site [duplicate]

Your action name and hooks don’t match. You have hooked to _ajax_news in the hook name:

add_action( 'wp_ajax_nopriv_ajax_news', 'ajax_news' );
add_action( 'wp_ajax_ajax_news', 'ajax_news' );

But the action you are sending in JavaScript is ajaxnews, without the underscore:

'action': 'ajaxnews', //calls wp_ajax_nopriv_ajaxnews

See how your own comment has a different name than the actual hooks you’ve used?

Either the JavaScript needs to send ajax_news as the action name, or the hooks need to be wp_ajax_nopriv_ajaxnews. They just need to be the same.