$headers Request headers as name => value. * @param float $timeout Seconds to allow for this attempt. * * @throws Cepis\NetworkException The request never completed. */ public function get( string $url, array $headers, float $timeout ): Cepis\Response { $response = wp_remote_get( $url, array( 'headers' => $headers, 'timeout' => $timeout, 'redirection' => 3, 'sslverify' => true, ) ); if ( is_wp_error( $response ) ) { throw new Cepis\NetworkException( esc_html( $response->get_error_message() ) ); } $response_headers = wp_remote_retrieve_headers( $response ); return new Cepis\Response( (int) wp_remote_retrieve_response_code( $response ), is_object( $response_headers ) ? $response_headers->getAll() : (array) $response_headers, (string) wp_remote_retrieve_body( $response ) ); } }