Title: Warning: http_build_query() expects parameter 1 to be array, string given
Last modified: August 3, 2021

---

# Warning: http_build_query() expects parameter 1 to be array, string given

 *  Resolved [gregmud](https://wordpress.org/support/users/gregmud/)
 * (@gregmud)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/warning-http_build_query-expects-parameter-1-to-be-array-string-given/)
 * We’ve been getting cloudflare warnings from the plugin. You can view the entire
   Sentry error here:
    [Sentry Error report](https://sentry.io/share/issue/628a44a3f93f44e795a12e11d092fde3/)
 * But the important bits are here:
 *     ```
       ErrorException
       Warning: http_build_query() expects parameter 1 to be array, string given
       ```
   
 *     ```
       /wp-content/plugins/wp-optimize-premium/cache/class-wp-optimize-cloudflare-api.php in WP_Optimize_Cloudflare_API::do_request at line 184
   
       		$url = self::API_URL . $endpoint. (!empty($query_params) ? '?'.http_build_query($query_params) : '');
       		$this->debug($url);
       		$this->debug($request_params);
       		$response = wp_remote_request($url, $request_params);
       		if (is_wp_error($response)) {
       			$this->debug($response);
       			return $response;
       		}
       ```
   
 * We run a multi-site install and have the cloudflare plugin installed as well.
    -  This topic was modified 4 years, 9 months ago by [gregmud](https://wordpress.org/support/users/gregmud/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/warning-http_build_query-expects-parameter-1-to-be-array-string-given/#post-14728496)
 * [@gregmud](https://wordpress.org/support/users/gregmud/) Do you get these warnings
   in WordPress admin or PHP error logs?
 *  Thread Starter [gregmud](https://wordpress.org/support/users/gregmud/)
 * (@gregmud)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/warning-http_build_query-expects-parameter-1-to-be-array-string-given/#post-14728688)
 * Logs
 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/warning-http_build_query-expects-parameter-1-to-be-array-string-given/#post-14732444)
 * [@gregmud](https://wordpress.org/support/users/gregmud/) I’ll share this with
   our development team for further investigation.\
 * Thank you for your time and patience.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Warning: http_build_query() expects parameter 1 to be array, string given’
is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Harshad](https://wordpress.org/support/users/bornforphp/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/warning-http_build_query-expects-parameter-1-to-be-array-string-given/#post-14732444)
 * Status: resolved