$method, 'headers' => $headers, 'timeout' => 20, ); if ( null !== $body ) { $args['body'] = $body; } $res = wp_remote_request( $url, $args ); if ( is_wp_error( $res ) ) { throw new TransportException( $res->get_error_message() ); } return array( 'status' => (int) wp_remote_retrieve_response_code( $res ), 'body' => (string) wp_remote_retrieve_body( $res ), ); } }