API client for Kitsu.io, with optional Anime collection, and optional Anilist syncing.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

MALRequestBuilder.php 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php declare(strict_types=1);
  2. /**
  3. * Hummingbird Anime List Client
  4. *
  5. * An API client for Kitsu and MyAnimeList to manage anime and manga watch lists
  6. *
  7. * PHP version 7
  8. *
  9. * @package HummingbirdAnimeClient
  10. * @author Timothy J. Warren <tim@timshomepage.net>
  11. * @copyright 2015 - 2018 Timothy J. Warren
  12. * @license http://www.opensource.org/licenses/mit-license.html MIT License
  13. * @version 4.0
  14. * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
  15. */
  16. namespace Aviat\AnimeClient\API\MAL;
  17. use Aviat\AnimeClient\API\{
  18. APIRequestBuilder,
  19. MAL as M
  20. };
  21. final class MALRequestBuilder extends APIRequestBuilder {
  22. /**
  23. * The base url for api requests
  24. * @var string $base_url
  25. */
  26. protected $baseUrl = M::BASE_URL;
  27. /**
  28. * HTTP headers to send with every request
  29. *
  30. * @var array
  31. */
  32. protected $defaultHeaders = [
  33. 'Accept' => 'text/xml',
  34. 'Accept-Encoding' => 'gzip',
  35. 'Content-type' => 'application/x-www-form-urlencoded',
  36. 'User-Agent' => "Tim's Anime Client/4.0"
  37. ];
  38. /**
  39. * Valid HTTP request methos
  40. * @var array
  41. */
  42. protected $validMethods = ['GET', 'POST', 'DELETE'];
  43. }