Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ryan Duff 2015 WordCamp US HTTP API

1,350 views

Published on

Leverage the built in WordPress HTTP API functions to make requests and stop using cURL

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Ryan Duff 2015 WordCamp US HTTP API

  1. 1. MAKING USE OF A LITTLE-KNOWN GEM: THE WORDPRESS HTTP API RYAN DUFF WordCamp US 2015
  2. 2. A FEW QUICK QUESTIONS
  3. 3. MY THEORY ON cURL USAGE
  4. 4. WHY USING cURL IS BAD
  5. 5. THE WORDPRESS HTTP API
  6. 6. 4 EASY TO USE WRAPPER FUNCTIONS wp_remote_get() wp_remote_post() wp_remote_head() wp_remote_request() wp_safe_remote_*()
  7. 7. PROCESSING RESPONSES wp_remote_retrieve_body() wp_remote_retrieve_header() wp_remote_retrieve_headers() wp_remote_retrieve_response_code() wp_remote_retrieve_response_message()
  8. 8. REQUESTS FOR PHP
  9. 9. A QUICK SIDEBAR ON CACHING
  10. 10. USEFUL API TOOLS POSTMAN Chrome app Free PAW Mac only (OS X 10.9+) $29.99 (Free trial; 30% discount for students) Extension to create HTTP API code from results
  11. 11. 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/WordPressCode Generator
  12. 12. QUESTIONS/CONTACT RYAN DUFF ryan@fusionized.com http://fusionized.com @ryancduff

×