Trying to get an api request getting error 404
Try using a GET request instead of a POST request. The headers indicate they only allow origin from weedmaps.com in the POST request. The method in WordPress is wp_remote_get(). function call_for_api() { $url=”https://api-v2.weedmaps.com/api/v2/listings”; $response = wp_remote_get( $url, array( ‘timeout’ => 45, ‘redirection’ => 5, ‘httpversion’ => ‘1.0’, ‘blocking’ => true, ‘headers’ => array( ‘accept’ => … Read more