[PHP]WordPress HTTP API
程序员文章站
2023-10-23 09:48:38
the wordpress http api makes fetching from or posting to remote servers a breeze. it does...
the wordpress http api makes fetching from or posting to remote servers a breeze. it does this by allowing you to be transport agnostic when you fetch or post something. the http api will choose the fastest and most reliable method out of the five different transports available in php. it’ll take care of discovering what transports are allowed on that server at that time.
the two most important functions and the ones you will probably use 99% of the time are:
-
wp_remote_get()
. -
wp_remote_post()
.$body = wp_remote_retrieve_body( wp_remote_get( 'https://mysite.com/' ) );
推荐阅读
-
PHP使用http_build_query()构造URL字符串的方法
-
调用WordPress函数统计文章访问量及PHP原生计数器的实现
-
PHP使用Alexa API获取网站的Alexa排名例子
-
[PHP] Http API with JSON data
-
详解WordPress中用于更新和获取用户选项数据的PHP函数
-
PHP开发api接口安全验证的实例讲解
-
PHP本地进行API接口测试的实例
-
ASP,PHP与.NET伪造HTTP-REFERER方法及防止伪造REFERER方法探讨
-
Java网络编程实现HTTP协议(Socket API)
-
php调用淘宝开放API实现根据卖家昵称获取卖家店铺ID的方法