ryan duff 2015 wordcamp us http api

13
MAKING USE OF A LITTLE-KNOWN GEM: THE WORDPRESS HTTP API RYAN DUFF WordCamp US 2015

Upload: ryanduff

Post on 19-Feb-2017

1.236 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Ryan Duff 2015 WordCamp US HTTP API

MAKING USE OF A L ITTLE-KNOWN GEM:

THE WORDPRESS HTTP API

RYAN DUFFWordCamp US 2015

Page 2: Ryan Duff 2015 WordCamp US HTTP API

A FEW QUICKQUESTIONS

Page 3: Ryan Duff 2015 WordCamp US HTTP API

MY THEORY ON cURL USAGE

Page 4: Ryan Duff 2015 WordCamp US HTTP API

WHY USING cURL

IS BAD

Page 5: Ryan Duff 2015 WordCamp US HTTP API
Page 6: Ryan Duff 2015 WordCamp US HTTP API

THE WORDPRESSHTTP API

Page 7: Ryan Duff 2015 WordCamp US HTTP API

4 EASY TO USE WRAPPER FUNCTIONS

wp_remote_get()

wp_remote_post()

wp_remote_head()

wp_remote_request()

wp_safe_remote_*()

Page 8: Ryan Duff 2015 WordCamp US HTTP API

PROCESSING RESPONSES

wp_remote_retrieve_body()

wp_remote_retrieve_header()

wp_remote_retrieve_headers()

wp_remote_retrieve_response_code()

wp_remote_retrieve_response_message()

Page 9: Ryan Duff 2015 WordCamp US HTTP API

REQUESTS FOR PHP

Page 10: Ryan Duff 2015 WordCamp US HTTP API

A QUICK SIDEBAR ON CACHING

Page 11: Ryan Duff 2015 WordCamp US HTTP API

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

Page 12: Ryan Duff 2015 WordCamp US HTTP API

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

Page 13: Ryan Duff 2015 WordCamp US HTTP API

QUESTIONS/CONTACTRYAN [email protected]

http://fusionized.com

@ryancduff