知识屋:更实用的电脑技术知识网站
所在位置:首页 > 编程技术 > PHP编程

[PHP]WordPress HTTP API

发布时间:2015-05-27 19:22:28作者:知识屋

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( 'http://mysite.com/' ) );


(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜