You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
503 B

  1. # PHP
  2. Below is an example of making a HTTP request to SITE_NAME from PHP.
  3. ```php
  4. file_get_contents('PING_URL');
  5. ```
  6. If you would like to setup timeout and retry options, as discussed in the
  7. [reliability tips section](../reliability_tips/), there is a
  8. [curl package](https://www.phpcurlclass.com/) available that lets you do that easily:
  9. ```php
  10. use Curl\Curl;
  11. $curl = new Curl();
  12. $curl->setRetry(20);
  13. $curl->setTimeout(5);
  14. $curl->get('PING_URL');
  15. ```
  16. Note: this code does not throw any exceptions.