SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
WP HTTP API Eunus Hosen! 
Co-Founder & CTO! 
DevsTeam
What is HTTP API
Why HTTP API 
❖ cURL : A library to communicate with remote hosts. Works only 
when the cURL extension is loaded into PHP.! 
❖ File system (fopen, file_get_contents) : This function opens up a file 
or an URL and this works when php ini_settings allows for this.! 
❖ Sockets (fsockopen) : Initiates a socket connection to the resource 
specified by host-name. Again it’s possible that the hosting company 
might have disabled the fsockopen function.! 
❖ Streams: Works on PHP 4.3 or later.! 
❖ HTTP: Provides a powerful request and parallel interface for remote 
calls. It needs PHP 5.2+
WP_HTTP Class
Helper Functions 
❖ wp_remote_get() - Retrieves a URL using the GET HTTP 
method.! 
❖ wp_remote_post() - Retrieves a URL using the POST HTTP 
method.! 
❖ wp_remote_head() - Retrieves a URL using the HEAD 
HTTP method.! 
❖ wp_remote_request() - Retrieves a URL using either the 
default GET or a custom HTTP method (should be caps) 
that you specify.
An Example
Response
Retrieve Body: wp_remote_retrieve_body($response)
Retrieve Body: wp_remote_retrieve_headers($response)
More Helper Functions 
❖ wp_remote_retrieve_body() - Retrieves just the body from the response.! 
❖ wp_remote_retrieve_header() - Gives you a single HTTP header based 
on name from the response.! 
❖ wp_remote_retrieve_headers() - Returns all of the HTTP headers in an 
array for processing.! 
❖ wp_remote_retrieve_response_code() - Gives you the number for the 
HTTP response. This should be 200, but could be 4xx or even 3xx on 
failure.! 
❖ wp_remote_retrieve_response_message() - Returns the response 
message based on the response code
Resources 
❖ wp_remote_get: http://codex.wordpress.org/Function_Reference/wp_remote_get! 
❖ wp_remote_post: http://codex.wordpress.org/Function_Reference/wp_remote_post! 
❖ wp_remote_head: http://codex.wordpress.org/Function_Reference/wp_remote_head! 
❖ wp_remote_retrieve_body : http://codex.wordpress.org/Function_Reference/ 
wp_remote_retrieve_body! 
❖ wp_remote_retrieve_headers : http://codex.wordpress.org/Function_Reference/ 
wp_remote_retrieve_headers! 
❖ wp_remote_retrieve_header: http://codex.wordpress.org/Function_Reference/ 
wp_remote_retrieve_header! 
❖ wp_remote_retrieve_response_code : http://codex.wordpress.org/Function_Reference/ 
wp_remote_retrieve_response_code! 
❖ wp_remote_retrieve_response_message : http://codex.wordpress.org/Function_Reference/ 
wp_remote_retrieve_response_message
Got a Question?
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

Php Server Var
Php Server VarPhp Server Var
Php Server Vararvind34
 
eZ Publish Cluster Unleashed
eZ Publish Cluster UnleashedeZ Publish Cluster Unleashed
eZ Publish Cluster UnleashedBertrand Dunogier
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentationAnnujj Agrawaal
 
[India Merge World Tour] Meru Networks
[India Merge World Tour] Meru Networks[India Merge World Tour] Meru Networks
[India Merge World Tour] Meru NetworksPerforce
 
Internationalization with TYPO3
Internationalization with TYPO3Internationalization with TYPO3
Internationalization with TYPO3digiparden GmbH
 
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)I Goo Lee
 
Introduction to Symfony Components and helper components in Drupal 8
Introduction to Symfony Components and helper components in Drupal 8Introduction to Symfony Components and helper components in Drupal 8
Introduction to Symfony Components and helper components in Drupal 8Ankit Babbar
 
Oracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web ServicesOracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web ServicesKim Berg Hansen
 
Heavy Web Optimization: Backend
Heavy Web Optimization: BackendHeavy Web Optimization: Backend
Heavy Web Optimization: BackendVõ Duy Tuấn
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hostingwebhostingguy
 
WordPress Theme & Plugin development best practices - phpXperts seminar 2011
WordPress Theme & Plugin development best practices - phpXperts seminar 2011WordPress Theme & Plugin development best practices - phpXperts seminar 2011
WordPress Theme & Plugin development best practices - phpXperts seminar 2011Tareq Hasan
 

Was ist angesagt? (20)

Psr 7 symfony-day
Psr 7 symfony-dayPsr 7 symfony-day
Psr 7 symfony-day
 
Php workshop L04 database
Php workshop L04 databasePhp workshop L04 database
Php workshop L04 database
 
Php workshop L03 superglobals
Php workshop L03 superglobalsPhp workshop L03 superglobals
Php workshop L03 superglobals
 
Php Server Var
Php Server VarPhp Server Var
Php Server Var
 
eZ Publish Cluster Unleashed
eZ Publish Cluster UnleashedeZ Publish Cluster Unleashed
eZ Publish Cluster Unleashed
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentation
 
[India Merge World Tour] Meru Networks
[India Merge World Tour] Meru Networks[India Merge World Tour] Meru Networks
[India Merge World Tour] Meru Networks
 
File Uploading in PHP
File Uploading in PHPFile Uploading in PHP
File Uploading in PHP
 
Internationalization with TYPO3
Internationalization with TYPO3Internationalization with TYPO3
Internationalization with TYPO3
 
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
 
Php 5.5
Php 5.5Php 5.5
Php 5.5
 
Real-Time Django
Real-Time DjangoReal-Time Django
Real-Time Django
 
Introduction to Symfony Components and helper components in Drupal 8
Introduction to Symfony Components and helper components in Drupal 8Introduction to Symfony Components and helper components in Drupal 8
Introduction to Symfony Components and helper components in Drupal 8
 
Varnish
VarnishVarnish
Varnish
 
Caching on the Edge
Caching on the EdgeCaching on the Edge
Caching on the Edge
 
Uploading a file with php
Uploading a file with phpUploading a file with php
Uploading a file with php
 
Oracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web ServicesOracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web Services
 
Heavy Web Optimization: Backend
Heavy Web Optimization: BackendHeavy Web Optimization: Backend
Heavy Web Optimization: Backend
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
 
WordPress Theme & Plugin development best practices - phpXperts seminar 2011
WordPress Theme & Plugin development best practices - phpXperts seminar 2011WordPress Theme & Plugin development best practices - phpXperts seminar 2011
WordPress Theme & Plugin development best practices - phpXperts seminar 2011
 

Andere mochten auch

WordPress Coding Standards & WP Hooks
WordPress Coding Standards & WP HooksWordPress Coding Standards & WP Hooks
WordPress Coding Standards & WP HooksEunus Hosen
 
Introduction to Web Development Career
Introduction to Web Development CareerIntroduction to Web Development Career
Introduction to Web Development CareerEunus Hosen
 
Career on WordPress: How to get started with WordPress
Career on WordPress: How to get started with WordPressCareer on WordPress: How to get started with WordPress
Career on WordPress: How to get started with WordPressEunus Hosen
 
2014 (1) debriefing
2014 (1) debriefing2014 (1) debriefing
2014 (1) debriefingUma Chitra
 
Branding highlights2002b
Branding highlights2002bBranding highlights2002b
Branding highlights2002bgdamon1010
 
Brocher ciri guru inovatif
Brocher ciri guru inovatifBrocher ciri guru inovatif
Brocher ciri guru inovatifUma Chitra
 
Apec women and the economy 2011 mo - australia
Apec women and the economy 2011   mo - australiaApec women and the economy 2011   mo - australia
Apec women and the economy 2011 mo - australiaotoolem
 
An example of cms - wordpress
An example of cms - wordpressAn example of cms - wordpress
An example of cms - wordpressEunus Hosen
 
Jeres powerpoint
Jeres powerpointJeres powerpoint
Jeres powerpointnikorayer
 
Women and the economy
Women and the economyWomen and the economy
Women and the economyotoolem
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPressEunus Hosen
 

Andere mochten auch (17)

WordPress Coding Standards & WP Hooks
WordPress Coding Standards & WP HooksWordPress Coding Standards & WP Hooks
WordPress Coding Standards & WP Hooks
 
Introduction to Web Development Career
Introduction to Web Development CareerIntroduction to Web Development Career
Introduction to Web Development Career
 
Career on WordPress: How to get started with WordPress
Career on WordPress: How to get started with WordPressCareer on WordPress: How to get started with WordPress
Career on WordPress: How to get started with WordPress
 
Premio Ramazzini & Carvalho
Premio  Ramazzini & CarvalhoPremio  Ramazzini & Carvalho
Premio Ramazzini & Carvalho
 
CV-Malawi
CV-MalawiCV-Malawi
CV-Malawi
 
Unique engineering
Unique engineeringUnique engineering
Unique engineering
 
2014 (1) debriefing
2014 (1) debriefing2014 (1) debriefing
2014 (1) debriefing
 
Branding highlights2002b
Branding highlights2002bBranding highlights2002b
Branding highlights2002b
 
Brocher ciri guru inovatif
Brocher ciri guru inovatifBrocher ciri guru inovatif
Brocher ciri guru inovatif
 
Lp week 1
Lp week 1Lp week 1
Lp week 1
 
Fan Page Biz-In-A-Box
Fan Page Biz-In-A-BoxFan Page Biz-In-A-Box
Fan Page Biz-In-A-Box
 
Apec women and the economy 2011 mo - australia
Apec women and the economy 2011   mo - australiaApec women and the economy 2011   mo - australia
Apec women and the economy 2011 mo - australia
 
An example of cms - wordpress
An example of cms - wordpressAn example of cms - wordpress
An example of cms - wordpress
 
Jeres powerpoint
Jeres powerpointJeres powerpoint
Jeres powerpoint
 
Protokoler
ProtokolerProtokoler
Protokoler
 
Women and the economy
Women and the economyWomen and the economy
Women and the economy
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPress
 

Ähnlich wie WP HTTP API Guide - Methods and Functions

nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicehazzaz
 
REST library.pptx
REST library.pptxREST library.pptx
REST library.pptxMSivani
 
Salesforce Integration using REST SOAP and HTTP callouts
Salesforce Integration using REST SOAP and HTTP calloutsSalesforce Integration using REST SOAP and HTTP callouts
Salesforce Integration using REST SOAP and HTTP calloutsRAMNARAYAN R
 
New Features in PHP 5.3
New Features in PHP 5.3New Features in PHP 5.3
New Features in PHP 5.3Bradley Holt
 
Future of HTTP in CakePHP
Future of HTTP in CakePHPFuture of HTTP in CakePHP
Future of HTTP in CakePHPmarkstory
 
MidwestPHP Symfony2 Internals
MidwestPHP Symfony2 InternalsMidwestPHP Symfony2 Internals
MidwestPHP Symfony2 InternalsRaul Fraile
 
Php 7 compliance workshop singapore
Php 7 compliance workshop singaporePhp 7 compliance workshop singapore
Php 7 compliance workshop singaporeDamien Seguy
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHPNat Weerawan
 
OpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML ResourcesOpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML ResourcesOpenTravel Alliance
 
Writing and using php streams and sockets tek11
Writing and using php streams and sockets   tek11Writing and using php streams and sockets   tek11
Writing and using php streams and sockets tek11Elizabeth Smith
 
Tips
TipsTips
Tipsmclee
 
Master the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexMaster the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexRyan Weaver
 
RESTful for opentravel.org by HP
RESTful for opentravel.org by HPRESTful for opentravel.org by HP
RESTful for opentravel.org by HPRoni Schuetz
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckrICh morrow
 
PHP MySQL Training : Module 3
PHP MySQL Training : Module 3PHP MySQL Training : Module 3
PHP MySQL Training : Module 3hussulinux
 
Under the Covers with the Web
Under the Covers with the WebUnder the Covers with the Web
Under the Covers with the WebTrevor Lohrbeer
 

Ähnlich wie WP HTTP API Guide - Methods and Functions (20)

nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-service
 
REST library.pptx
REST library.pptxREST library.pptx
REST library.pptx
 
Salesforce Integration using REST SOAP and HTTP callouts
Salesforce Integration using REST SOAP and HTTP calloutsSalesforce Integration using REST SOAP and HTTP callouts
Salesforce Integration using REST SOAP and HTTP callouts
 
New Features in PHP 5.3
New Features in PHP 5.3New Features in PHP 5.3
New Features in PHP 5.3
 
Future of HTTP in CakePHP
Future of HTTP in CakePHPFuture of HTTP in CakePHP
Future of HTTP in CakePHP
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
MidwestPHP Symfony2 Internals
MidwestPHP Symfony2 InternalsMidwestPHP Symfony2 Internals
MidwestPHP Symfony2 Internals
 
Php 7 compliance workshop singapore
Php 7 compliance workshop singaporePhp 7 compliance workshop singapore
Php 7 compliance workshop singapore
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
 
OpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML ResourcesOpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML Resources
 
Writing and using php streams and sockets tek11
Writing and using php streams and sockets   tek11Writing and using php streams and sockets   tek11
Writing and using php streams and sockets tek11
 
Tips
TipsTips
Tips
 
Master the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexMaster the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and Silex
 
RESTful for opentravel.org by HP
RESTful for opentravel.org by HPRESTful for opentravel.org by HP
RESTful for opentravel.org by HP
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course Deck
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6
 
PHP MySQL Training : Module 3
PHP MySQL Training : Module 3PHP MySQL Training : Module 3
PHP MySQL Training : Module 3
 
Under the Covers with the Web
Under the Covers with the WebUnder the Covers with the Web
Under the Covers with the Web
 

Kürzlich hochgeladen

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Kürzlich hochgeladen (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

WP HTTP API Guide - Methods and Functions

  • 1. WP HTTP API Eunus Hosen! Co-Founder & CTO! DevsTeam
  • 3. Why HTTP API ❖ cURL : A library to communicate with remote hosts. Works only when the cURL extension is loaded into PHP.! ❖ File system (fopen, file_get_contents) : This function opens up a file or an URL and this works when php ini_settings allows for this.! ❖ Sockets (fsockopen) : Initiates a socket connection to the resource specified by host-name. Again it’s possible that the hosting company might have disabled the fsockopen function.! ❖ Streams: Works on PHP 4.3 or later.! ❖ HTTP: Provides a powerful request and parallel interface for remote calls. It needs PHP 5.2+
  • 5. Helper Functions ❖ wp_remote_get() - Retrieves a URL using the GET HTTP method.! ❖ wp_remote_post() - Retrieves a URL using the POST HTTP method.! ❖ wp_remote_head() - Retrieves a URL using the HEAD HTTP method.! ❖ wp_remote_request() - Retrieves a URL using either the default GET or a custom HTTP method (should be caps) that you specify.
  • 10. More Helper Functions ❖ wp_remote_retrieve_body() - Retrieves just the body from the response.! ❖ wp_remote_retrieve_header() - Gives you a single HTTP header based on name from the response.! ❖ wp_remote_retrieve_headers() - Returns all of the HTTP headers in an array for processing.! ❖ wp_remote_retrieve_response_code() - Gives you the number for the HTTP response. This should be 200, but could be 4xx or even 3xx on failure.! ❖ wp_remote_retrieve_response_message() - Returns the response message based on the response code
  • 11. Resources ❖ wp_remote_get: http://codex.wordpress.org/Function_Reference/wp_remote_get! ❖ wp_remote_post: http://codex.wordpress.org/Function_Reference/wp_remote_post! ❖ wp_remote_head: http://codex.wordpress.org/Function_Reference/wp_remote_head! ❖ wp_remote_retrieve_body : http://codex.wordpress.org/Function_Reference/ wp_remote_retrieve_body! ❖ wp_remote_retrieve_headers : http://codex.wordpress.org/Function_Reference/ wp_remote_retrieve_headers! ❖ wp_remote_retrieve_header: http://codex.wordpress.org/Function_Reference/ wp_remote_retrieve_header! ❖ wp_remote_retrieve_response_code : http://codex.wordpress.org/Function_Reference/ wp_remote_retrieve_response_code! ❖ wp_remote_retrieve_response_message : http://codex.wordpress.org/Function_Reference/ wp_remote_retrieve_response_message