Http.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. /**
  3. * Licensed to Jasig under one or more contributor license
  4. * agreements. See the NOTICE file distributed with this work for
  5. * additional information regarding copyright ownership.
  6. *
  7. * Jasig licenses this file to you under the Apache License,
  8. * Version 2.0 (the "License"); you may not use this file except in
  9. * compliance with the License. You may obtain a copy of the License at:
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. *
  19. * PHP Version 5
  20. *
  21. * @file CAS/ProxiedService/Http.php
  22. * @category Authentication
  23. * @package PhpCAS
  24. * @author Adam Franco <afranco@middlebury.edu>
  25. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  26. * @link https://wiki.jasig.org/display/CASC/phpCAS
  27. */
  28. /**
  29. * This interface defines methods that clients should use for configuring, sending,
  30. * and receiving proxied HTTP requests.
  31. *
  32. * @class CAS_ProxiedService_Http
  33. * @category Authentication
  34. * @package PhpCAS
  35. * @author Adam Franco <afranco@middlebury.edu>
  36. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  37. * @link https://wiki.jasig.org/display/CASC/phpCAS
  38. */
  39. interface CAS_ProxiedService_Http
  40. {
  41. /*********************************************************
  42. * Configure the Request
  43. *********************************************************/
  44. /**
  45. * Set the URL of the Request
  46. *
  47. * @param string $url Url to set
  48. *
  49. * @return void
  50. * @throws CAS_OutOfSequenceException If called after the Request has been sent.
  51. */
  52. public function setUrl ($url);
  53. /*********************************************************
  54. * 2. Send the Request
  55. *********************************************************/
  56. /**
  57. * Perform the request.
  58. *
  59. * @return bool TRUE on success, FALSE on failure.
  60. * @throws CAS_OutOfSequenceException If called multiple times.
  61. */
  62. public function send ();
  63. /*********************************************************
  64. * 3. Access the response
  65. *********************************************************/
  66. /**
  67. * Answer the headers of the response.
  68. *
  69. * @return array An array of header strings.
  70. * @throws CAS_OutOfSequenceException If called before the Request has been sent.
  71. */
  72. public function getResponseHeaders ();
  73. /**
  74. * Answer the body of response.
  75. *
  76. * @return string
  77. * @throws CAS_OutOfSequenceException If called before the Request has been sent.
  78. */
  79. public function getResponseBody ();
  80. }
  81. ?>