Like XML-RPC, we will need to create a REST request with PHP and use PHP to process the response. Unlike XML-RPC, there are no functions created specifically for REST, but that is not necessary. As REST uses just a simple HTTP request, we can use the existing network functions to make and capture the response. The results will come back in XML. We will look at two ways of processing it and turning into PHP data that we can use.
Like we talked about earlier, REST is basically like a web page request to the web server. It does not get any more glamorous than that. We will look at a couple of ways to initiate this hit.
We constructed a POST
request earlier in order to make our XML-RPC call. Let’s take a closer and quick look at the differences between a GET
header and a POST
header.
Here is a bare bones GET
request
GET /aService.php?One=1&Two=2+and+2%25&Three=3 HTTP/1.0 Host: localhost User-Agent: A PHP Client
There are...