2017 © Pedro Peláez
 

library simple-request-json

Simple class implement request with JSON body.

image

vitalik74/simple-request-json

Simple class implement request with JSON body.

  • Monday, April 20, 2015
  • by vitalik74
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Simple class implement request with JSON body (simple-request-json)

REQUIREMENTS

The minimum requirement by this application template that your Web server supports PHP 5.4.0., (*1)

INSTALLATION

Install via Composer

If you do not have Composer, you may install it by following the instructions at getcomposer.org., (*2)

You can then install this widget. Put in your composer.json in require case:, (*3)

"vitalik74/simple-request-json": "*"

And run command "composer update"., (*4)

USE

Data request run from Curl in default. If Curl not installed in system data request run from file_get_contents function., (*5)

Example, how to use:

$response = (new Request(['url' => 'Url ', 'postData' => 'post data']))->getResponse();

Or, (*6)

$response = new Request(['url' => 'Url ', 'postData' => 'post data']);
$response = $response->getResponse();

Or, (*7)

$response = new Request();
$response->url = 'url';
$response->postData = 'post data';
$response->method = 'GET';// default in POST
$response = $response->getResponse();

Public property

$postData - Post data to put in server., (*8)

$url - Url from server., (*9)

$method - POST or GET method., (*10)

$toArray - Convert response from server to array with json_decode function, (*11)

$noData - If you no set data set this property to true, (*12)

$sendToJsonFormat - Send to server with json format (add special header), (*13)

The Versions

20/04 2015

dev-master

9999999-dev

Simple class implement request with JSON body.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

request request with json request json request with json body simple request