AI编程助手
AI免费问答

[PHP]WordPress HTTP API

  2016-06-06 19:59   1509浏览 原创

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 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/' ) );


大量免费API接口:立即使用
涵盖生活服务API、金融科技API、企业工商API、等相关的API接口服务。免费API接口可安全、合规地连接上下游,为数据API应用能力赋能!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。