Hi @logicred
You should be able to write some custom code that uses the http_api_curl() hook to do this. Here’s an untested example that you can modify as needed:
// POST parameters when fetching feed
add_action( 'http_api_curl', 'my_curl_set_opts', 10, 3 );
function my_curl_set_opts( $handle, $r, $url ) {
if ( $url == 'https://example.com/jsonfeed' ) {
$data = array(
'client' => 'CUSTOMER CODE',
'login' => 'LOGIN',
'pass' => 'PASSWORD'
);
$post_params = '';
foreach ( $data as $pn => $pv ) {
$post_params .= ( $post_params == '' ? '' : '&' ) . $pn . '=' . urlencode( $pv );
}
curl_setopt( $handle, CURLOPT_POST, true );
curl_setopt( $handle, CURLOPT_POSTFIELDS, $post_params );
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
// Optional below (disable host/peer verification in case of SSL errors)
// curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, false );
// curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, 0 );
}
}