Post on 19-Feb-2017
MAKING USE OF A L ITTLE-KNOWN GEM:
THE WORDPRESS HTTP API
RYAN DUFFWordCamp US 2015
A FEW QUICKQUESTIONS
MY THEORY ON cURL USAGE
WHY USING cURL
IS BAD
THE WORDPRESSHTTP API
4 EASY TO USE WRAPPER FUNCTIONS
wp_remote_get()
wp_remote_post()
wp_remote_head()
wp_remote_request()
wp_safe_remote_*()
PROCESSING RESPONSES
wp_remote_retrieve_body()
wp_remote_retrieve_header()
wp_remote_retrieve_headers()
wp_remote_retrieve_response_code()
wp_remote_retrieve_response_message()
REQUESTS FOR PHP
A QUICK SIDEBAR ON CACHING
USEFUL API TOOLS
POSTMANChrome app
Free
PAWMac only (OS X 10.9+)
$29.99 (Free trial; 30% discount for students)
Extension to create HTTP API code from results
LINKS
https://developer.wordpress.org/plugins/http-api/
https://codex.wordpress.org/HTTP_API
http://requests.ryanmccue.info/
https://core.trac.wordpress.org/ticket/33055
https://www.getpostman.com/
https://luckymarmot.com/paw
https://luckymarmot.com/paw/extensions/WordPressCodeGenerator
QUESTIONS/CONTACTRYAN DUFFryan@fusionized.com
http://fusionized.com
@ryancduff