2017 © Pedro Peláez
 

library simple-api-client

simple api library.

image

ienaga/simple-api-client

simple api library.

  • Tuesday, August 22, 2017
  • by ienaga
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5,606 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

SimpleApiClient

simple api library., (*1)

UnitTest PHPMD Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Composer

{
    "require": {
       "ienaga/simple-api-client": "*"
    }
}

Usage

GET (AWS ElasticSearch)

$client = new \SimpleApi\Client();
$json = $client
    ->setEndPoint("https://search-****.ap-northeast-1.es.amazonaws.com")
    ->setPath("/index_name/type_name/_search?q=user:kimchy")
    ->send();

POST (Google FireBase)

$client = new \SimpleApi\Client();
$json = $client
    ->addHeader("Authorization", "key=XXXXXXX")
    ->setEndPoint("https://fcm.googleapis.com/fcm/send")
    ->setMethod("POST")
    ->add("to", "INSTANCE_ID")
    ->add("priority", "high")
    ->add("content_available", true)
    ->add("notification", [
        "title" => "title", 
        "body"  => "body", 
        "badge" => 1
    ])
    ->send();

PUT (AWS ElasticSearch)

$client = new \SimpleApi\Client();
$json = $client
    ->setEndPoint("https://search-****.ap-northeast-1.es.amazonaws.com")
    ->setPath("/index_name/type_name")
    ->setMethod("PUT")
    ->add("status", 2)
    ->send();

DELETE (AWS ElasticSearch)

$client = new \SimpleApi\Client();
$json = $client
    ->setEndPoint("https://search-****.ap-northeast-1.es.amazonaws.com")
    ->setPath("/index_name")
    ->setMethod("DELETE")
    ->send();

The Versions

22/08 2017

dev-master

9999999-dev https://github.com/ienaga/SimpleApiClient

simple api library.

  Sources   Download

MIT

The Development Requires

by Toshiyuki Ienaga

api elasticsearch aws firebase

22/08 2017

1.0.0

1.0.0.0 https://github.com/ienaga/SimpleApiClient

simple api library.

  Sources   Download

MIT

The Development Requires

by Toshiyuki Ienaga

api elasticsearch aws firebase