ortex/getyourbit 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ortex/getyourbit

Composer 安装命令:

composer require ortex/getyourbit

包简介

Getyourbit.com client

README 文档

README

This library allows you to make requests easily.

Examples

require 'vendor/autoload.php';    

use GetYourBit\Api;

// create an instance
$api = new Api('https://ip.getyourbit.com/');

// login
$api->auth('login', 'password');

// request without scrolling
$body = $api->request("/lookup/8.8.8.8", array('locale': 'en-US'));
var_dump($body['data']);

// request with scrolling
$result = $api->scroll("/find/", array(
    'size': 500,
    'query' => array(
        'country' => 'nepal'
    )
));
echo count($result);

//logout
$api->logout();

Api

.auth($login, $password, $options=array())

Login to the API. You can get $login and $password on the site after a subscription.
$options is requests module options. You can also pass headers as option
Free services don't require authorization.

.logout()

Logout from the API. It gives an error without authorization before.

.request($url, $data=array(), $options=array())

Request to the API without scrolling to get data.
It returns all response body as object.

.scroll($url, $data=array(), $options=array(), $callback=null)

.scroll($url, $data=array(), $callback=null)

.scroll($url, $callback=null)

Request to the API with scrolling to get data. You can pass callback to control every chunk. You will get three arguments:

  • $body - chunk response body
  • $chunkData - chunk data
  • $fullData - full data by the current chunk

It returns the full data at the end

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固