Geen omschrijving

interface-wc-api-handler.php 845B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * WooCommerce API
  4. *
  5. * Defines an interface that API request/response handlers should implement
  6. *
  7. * @author WooThemes
  8. * @category API
  9. * @package WooCommerce\RestApi
  10. * @since 2.1
  11. */
  12. if ( ! defined( 'ABSPATH' ) ) {
  13. exit; // Exit if accessed directly
  14. }
  15. interface WC_API_Handler {
  16. /**
  17. * Get the content type for the response
  18. *
  19. * This should return the proper HTTP content-type for the response
  20. *
  21. * @since 2.1
  22. * @return string
  23. */
  24. public function get_content_type();
  25. /**
  26. * Parse the raw request body entity into an array
  27. *
  28. * @since 2.1
  29. * @param string $data
  30. * @return array
  31. */
  32. public function parse_body( $data );
  33. /**
  34. * Generate a response from an array of data
  35. *
  36. * @since 2.1
  37. * @param array $data
  38. * @return string
  39. */
  40. public function generate_response( $data );
  41. }