Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WordPress] Sending Authorization Headers with WordPress
<?php
$response = wp_safe_remote_post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => $token
],
'body' => wp_json_encode($args),
'method' => 'POST',
'data_format' => 'body',
]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.