UrlEncodedParser.php 615 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\httpclient;
  8. use yii\base\Object;
  9. /**
  10. * UrlEncodedParser parses HTTP message content as 'application/x-www-form-urlencoded'.
  11. *
  12. * @author Paul Klimov <klimov.paul@gmail.com>
  13. * @since 2.0
  14. */
  15. class UrlEncodedParser extends Object implements ParserInterface
  16. {
  17. /**
  18. * @inheritdoc
  19. */
  20. public function parse(Response $response)
  21. {
  22. $data = [];
  23. parse_str($response->getContent(), $data);
  24. return $data;
  25. }
  26. }