This implementation uses what is called a REST API interface. REST stands for REpresentational State Transfer. It is not really a protocol but it is a design strategy for transferring data using HTML. Basically you use the data of the URL that you are getting or putting to communicate with a remote device. You can find more information on REST design at http://www.restapitutorial.com/lessons/whatisrest.html or other similar websites.
In our implementation we are using the URL to transmit the protocol number, data value, and number of bits. So for example if your device is at IP address 22.214.171.124 you could simply browse to this web URL.
The first thing after the IP address is the word "irsend". This would probably be unecessary because all of our commands to this device are in the form of an infrared send command. However we have implemented it this way so that if you wanted to send other commands to this device you can modify the program to do something different depending upon this first item after the IP address. Then separated by slashes we have the protocol number which in this case is 2, the data value in decimal, optionally followed by a slash and the number of bits. Note that we normally record data values in hex but our interface as we have designed it must be in decimal.
""PUT /irsend/1/16582903/0/ HTTP/1.1
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
It is the job of the code in your Arduino sketch to capture this data using "client.readString()" or "client.read()" or "client.parseInt()" calls to extract the various parts of the URL. The main loop makes sure that it begins with "irsend" and then it calls the function "processIR(client)" to process the rest of the URL and get the protocol number, data value, an optionally number of bits.