WordPress Making network requests with HTTP API

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • $response = wp_remote_get( $url, $args );
  • $response = wp_remote_post( $url, $args );
  • $response = wp_safe_remote_post( $url, $args );

Parameters

ParameterDetails
$url(string) (Required) Site URL to retrieve.
$args(array) (Optional) Request arguments.

Remarks

Returns

(WP_Error | array) The response as an array, or WP_Error on failure.



Got any WordPress Question?