You are here

README.txt in HTTP Parallel Request & Threading Library 6

Same filename and directory in other branches
  1. 7 README.txt
------------------------------------------------
HTTP PARALLEL REQUEST & THREADING LIBRARY MODULE
------------------------------------------------


CONTENTS OF THIS FILE
---------------------

 * About HTTPRL
 * Requirements
 * Configuration
 * API Overview
 * Technical Details
 * Code Examples


ABOUT HTTPRL
------------

http://drupal.org/project/httprl

HTTPRL is a flexible and powerful HTTP client implementation. Correctly handles
GET, POST, PUT or any other HTTP requests & the sending of data. Issue blocking
or non-blocking requests in parallel. Set timeouts, max simultaneous connection
limits, chunk size, and max redirects to follow. Can handle data with
content-encoding and transfer-encoding headers set. Correctly follows
redirects. Option to forward the referrer when a redirect is found. Cookie
extraction and parsing into key value pairs. Can multipart encode data so files
can easily be sent in a HTTP request. Will emulate a range request if the server
does not support range requests.


REQUIREMENTS
------------

Requires PHP 5. The following functions must be available on the server:
 * stream_socket_client
 * stream_select
 * stream_set_blocking
 * stream_get_meta_data
 * stream_socket_get_name
Some hosting providers disable these functions; but they do come standard with
PHP 5.


CONFIGURATION
-------------

Settings page is located at:
6.x: admin/settings/httprl
7.x: admin/config/development/httprl

 * IP Address to send all self server requests to. If left blank it will use the
   same server as the request. If set to -1 it will use the host name instead of
   an IP address. This controls the output of httprl_build_url_self().
 * Enable background callbacks. If disabled all background_callback keys will
   be turned into callback & httprl_queue_background_callback will return NULL
   and not queue up the request. Note that background callbacks will
   automatically be disabled if the site is in maintenance mode.


API OVERVIEW
------------

Issue HTTP Requests:
httprl_build_url_self()
 - Helper function to build an URL for asynchronous requests to self. Note that
   you should set the Host name in the headers when using this.
httprl_request()
 - Queue up a HTTP request in httprl_send_request().
httprl_send_request()
 - Perform many HTTP requests.

Create and use a thread:
httprl_queue_background_callback()
 - Queue a special HTTP request (used for threading) in httprl_send_request().

Other Functions:
httprl_is_background_callback_capable()
 - See if httprl can issue a background callback.
httprl_background_processing()
 - Output text, close connection, continue processing in the background.
httprl_strlen()
 - Get the length of a string in bytes.
httprl_glue_url()
 - Alt to http_build_url().
httprl_get_server_schema()
 - Return the server schema (http or https).
httprl_pr()
 - Pretty print data.
httprl_fast403()
 - Issue a 403 and exit.


TECHNICAL DETAILS
-----------------

Using stream_select() HTTPRL will send http requests out in parallel. These
requests can be made in a blocking or non-blocking way. Blocking will wait for
the http response; Non-Blocking will close the connection not waiting for the
response back. The API for httprl is similar to the Drupal 7 version of
drupal_http_request().

HTTPRL can be used independent of drupal. For basic operations it doesn't
require any built in drupal functions.


CODE EXAMPLES
-------------

See examples/httprl.examples.php for code examples.

File

README.txt
View source
  1. ------------------------------------------------
  2. HTTP PARALLEL REQUEST & THREADING LIBRARY MODULE
  3. ------------------------------------------------
  4. CONTENTS OF THIS FILE
  5. ---------------------
  6. * About HTTPRL
  7. * Requirements
  8. * Configuration
  9. * API Overview
  10. * Technical Details
  11. * Code Examples
  12. ABOUT HTTPRL
  13. ------------
  14. http://drupal.org/project/httprl
  15. HTTPRL is a flexible and powerful HTTP client implementation. Correctly handles
  16. GET, POST, PUT or any other HTTP requests & the sending of data. Issue blocking
  17. or non-blocking requests in parallel. Set timeouts, max simultaneous connection
  18. limits, chunk size, and max redirects to follow. Can handle data with
  19. content-encoding and transfer-encoding headers set. Correctly follows
  20. redirects. Option to forward the referrer when a redirect is found. Cookie
  21. extraction and parsing into key value pairs. Can multipart encode data so files
  22. can easily be sent in a HTTP request. Will emulate a range request if the server
  23. does not support range requests.
  24. REQUIREMENTS
  25. ------------
  26. Requires PHP 5. The following functions must be available on the server:
  27. * stream_socket_client
  28. * stream_select
  29. * stream_set_blocking
  30. * stream_get_meta_data
  31. * stream_socket_get_name
  32. Some hosting providers disable these functions; but they do come standard with
  33. PHP 5.
  34. CONFIGURATION
  35. -------------
  36. Settings page is located at:
  37. 6.x: admin/settings/httprl
  38. 7.x: admin/config/development/httprl
  39. * IP Address to send all self server requests to. If left blank it will use the
  40. same server as the request. If set to -1 it will use the host name instead of
  41. an IP address. This controls the output of httprl_build_url_self().
  42. * Enable background callbacks. If disabled all background_callback keys will
  43. be turned into callback & httprl_queue_background_callback will return NULL
  44. and not queue up the request. Note that background callbacks will
  45. automatically be disabled if the site is in maintenance mode.
  46. API OVERVIEW
  47. ------------
  48. Issue HTTP Requests:
  49. httprl_build_url_self()
  50. - Helper function to build an URL for asynchronous requests to self. Note that
  51. you should set the Host name in the headers when using this.
  52. httprl_request()
  53. - Queue up a HTTP request in httprl_send_request().
  54. httprl_send_request()
  55. - Perform many HTTP requests.
  56. Create and use a thread:
  57. httprl_queue_background_callback()
  58. - Queue a special HTTP request (used for threading) in httprl_send_request().
  59. Other Functions:
  60. httprl_is_background_callback_capable()
  61. - See if httprl can issue a background callback.
  62. httprl_background_processing()
  63. - Output text, close connection, continue processing in the background.
  64. httprl_strlen()
  65. - Get the length of a string in bytes.
  66. httprl_glue_url()
  67. - Alt to http_build_url().
  68. httprl_get_server_schema()
  69. - Return the server schema (http or https).
  70. httprl_pr()
  71. - Pretty print data.
  72. httprl_fast403()
  73. - Issue a 403 and exit.
  74. TECHNICAL DETAILS
  75. -----------------
  76. Using stream_select() HTTPRL will send http requests out in parallel. These
  77. requests can be made in a blocking or non-blocking way. Blocking will wait for
  78. the http response; Non-Blocking will close the connection not waiting for the
  79. response back. The API for httprl is similar to the Drupal 7 version of
  80. drupal_http_request().
  81. HTTPRL can be used independent of drupal. For basic operations it doesn't
  82. require any built in drupal functions.
  83. CODE EXAMPLES
  84. -------------
  85. See examples/httprl.examples.php for code examples.