ayctor/geoapifr

geo api fr的轻量级PHP客户端库

0.0.2 2019-07-05 09:11 UTC

This package is auto-updated.

Last update: 2024-08-27 17:43:44 UTC


README

这是一个用于使用GéoAPI的轻量级PHP客户端库。

查看官方文档以了解可用的方法。

安装

composer require ayctor/geoapifr

使用

use GeoApiFr\GeoApiFr;

// Create instance

$instance = new GeoApiFr;

$regions = $instance->get('regions');

// OR

$versailles = GeoApiFr::getInstance()->get('communes', ['nom' => 'versailles']);

错误

如果请求为空,将返回一个空数组。

如果发生错误400,将返回GuzzleHttp\Exception\RequestException对象。