How can I set the content-type
field to application/json
in the header of my HTTP request when using the function wp_remote_post
?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Check the documentation for
wp_remote_post
which will give you some extra information on what you can do with the remote request.When you make the request using that function, you can set headers in the second parameter (
$args
) within an array. For example: