Properties

$baseUri

$baseUri : 

Type

$httpClient

$httpClient : \GuzzleHttp\ClientInterface

Type

\GuzzleHttp\ClientInterface

$middlewares

$middlewares : array

Type

array

$handlerStack

$handlerStack : \GuzzleHttp\HandlerStack

Type

\GuzzleHttp\HandlerStack

$defaults

$defaults : array

Type

array

Methods

httpGet()

httpGet(string  $url, array  $query = array()) : \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

GET request.

Parameters

string $url
array $query

Throws

\EasyWeChat\Kernel\Exceptions\InvalidConfigException

Returns

\Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

httpPost()

httpPost(string  $url, array  $data = array()) : \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

POST request.

Parameters

string $url
array $data

Throws

\EasyWeChat\Kernel\Exceptions\InvalidConfigException

Returns

\Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

httpPostJson()

httpPostJson(string  $url, string|array  $data = array(), array  $query = array()) : \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

JSON request.

Parameters

string $url
string|array $data
array $query

Throws

\EasyWeChat\Kernel\Exceptions\InvalidConfigException

Returns

\Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

httpUpload()

httpUpload(string  $url, array  $files = array(), array  $form = array(), array  $query = array()) : \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

Upload file.

Parameters

string $url
array $files
array $form
array $query

Throws

\EasyWeChat\Kernel\Exceptions\InvalidConfigException

Returns

\Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

request()

request(string  $url, string  $method = 'GET', array  $options = array()) : \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

Make a request.

Parameters

string $url
string $method
array $options

Returns

\Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string

requestRaw()

requestRaw(string  $url, string  $method = 'GET', array  $options = array()) : \EasyWeChat\Kernel\Http\Response

Parameters

string $url
string $method
array $options

Throws

\EasyWeChat\Kernel\Exceptions\InvalidConfigException

Returns

\EasyWeChat\Kernel\Http\Response

getHttpClient()

getHttpClient() : \GuzzleHttp\ClientInterface

Return GuzzleHttp\ClientInterface instance.

Returns

\GuzzleHttp\ClientInterface

setDefaultOptions()

setDefaultOptions(array  $defaults = array()) 

Set guzzle default settings.

Parameters

array $defaults

getDefaultOptions()

getDefaultOptions() : array

Return current guzzle default settings.

Returns

array

setHttpClient()

setHttpClient(\GuzzleHttp\ClientInterface  $httpClient) : $this

Set GuzzleHttp\Client.

Parameters

\GuzzleHttp\ClientInterface $httpClient

Returns

$this

pushMiddleware()

pushMiddleware(callable  $middleware, null|string  $name = null) : $this

Add a middleware.

Parameters

callable $middleware
null|string $name

Returns

$this

getMiddlewares()

getMiddlewares() : array

Return all middlewares.

Returns

array

setHandlerStack()

setHandlerStack(\GuzzleHttp\HandlerStack  $handlerStack) : $this

Parameters

\GuzzleHttp\HandlerStack $handlerStack

Returns

$this

getHandlerStack()

getHandlerStack() : \GuzzleHttp\HandlerStack

Build a handler stack.

Returns

\GuzzleHttp\HandlerStack

userSummary()

userSummary(string  $from, string  $to) : mixed

获取用户增减数据.

Parameters

string $from
string $to

Returns

mixed

userCumulate()

userCumulate(string  $from, string  $to) : mixed

获取累计用户数据.

Parameters

string $from
string $to

Returns

mixed

articleSummary()

articleSummary(string  $from, string  $to) : mixed

获取图文群发每日数据.

Parameters

string $from
string $to

Returns

mixed

articleTotal()

articleTotal(string  $from, string  $to) : mixed

获取图文群发总数据.

Parameters

string $from
string $to

Returns

mixed

userReadSummary()

userReadSummary(string  $from, string  $to) : mixed

获取图文统计数据.

Parameters

string $from
string $to

Returns

mixed

userReadHourly()

userReadHourly(string  $from, string  $to) : mixed

获取图文统计分时数据.

Parameters

string $from
string $to

Returns

mixed

userShareSummary()

userShareSummary(string  $from, string  $to) : mixed

获取图文分享转发数据.

Parameters

string $from
string $to

Returns

mixed

userShareHourly()

userShareHourly(string  $from, string  $to) : mixed

获取图文分享转发分时数据.

Parameters

string $from
string $to

Returns

mixed

upstreamMessageSummary()

upstreamMessageSummary(string  $from, string  $to) : mixed

获取消息发送概况数据.

Parameters

string $from
string $to

Returns

mixed

upstreamMessageHourly()

upstreamMessageHourly(string  $from, string  $to) : mixed

获取消息分送分时数据.

Parameters

string $from
string $to

Returns

mixed

upstreamMessageWeekly()

upstreamMessageWeekly(string  $from, string  $to) : mixed

获取消息发送周数据.

Parameters

string $from
string $to

Returns

mixed

upstreamMessageMonthly()

upstreamMessageMonthly(string  $from, string  $to) : mixed

获取消息发送月数据.

Parameters

string $from
string $to

Returns

mixed

upstreamMessageDistSummary()

upstreamMessageDistSummary(string  $from, string  $to) : mixed

获取消息发送分布数据.

Parameters

string $from
string $to

Returns

mixed

upstreamMessageDistWeekly()

upstreamMessageDistWeekly(string  $from, string  $to) : mixed

获取消息发送分布周数据.

Parameters

string $from
string $to

Returns

mixed

upstreamMessageDistMonthly()

upstreamMessageDistMonthly(string  $from, string  $to) : mixed

获取消息发送分布月数据.

Parameters

string $from
string $to

Returns

mixed

interfaceSummary()

interfaceSummary(string  $from, string  $to) : mixed

获取接口分析数据.

Parameters

string $from
string $to

Returns

mixed

interfaceSummaryHourly()

interfaceSummaryHourly(string  $from, string  $to) : mixed

获取接口分析分时数据.

Parameters

string $from
string $to

Returns

mixed

cardSummary()

cardSummary(string  $from, string  $to, integer  $condSource) : mixed

拉取卡券概况数据接口.

Parameters

string $from
string $to
integer $condSource

Returns

mixed

freeCardSummary()

freeCardSummary(string  $from, string  $to, integer  $condSource, string  $cardId = '') : mixed

获取免费券数据接口.

Parameters

string $from
string $to
integer $condSource
string $cardId

Returns

mixed

memberCardSummary()

memberCardSummary(string  $from, string  $to, integer  $condSource) : mixed

拉取会员卡数据接口.

Parameters

string $from
string $to
integer $condSource

Returns

mixed

memberCardSummaryById()

memberCardSummaryById(string  $from, string  $to, string  $cardId) : mixed

拉取单张会员卡数据接口.

Parameters

string $from
string $to
string $cardId

Returns

mixed

registerHttpMiddlewares()

registerHttpMiddlewares() 

Register Guzzle middlewares.

accessTokenMiddleware()

accessTokenMiddleware() : \Closure

Attache access token to request query.

Returns

\Closure

logMiddleware()

logMiddleware() : \Closure

Log the request.

Returns

\Closure

retryMiddleware()

retryMiddleware() : \Closure

Return retry middleware.

Returns

\Closure

fixJsonIssue()

fixJsonIssue(array  $options) : array

Parameters

array $options

Returns

array

query()

query(string  $api, string  $from, string  $to, array  $ext = array()) : mixed

查询数据.

Parameters

string $api
string $from
string $to
array $ext

Returns

mixed