Download the PHP package srikant-kumar/simple-http-request without Composer

On this page you can find all versions of the php package srikant-kumar/simple-http-request. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package simple-http-request

Simple HTTP Request : PHP

The "Simple HTTP Request" class in PHP offers a user-friendly solution for making versatile server-to-server requests without requiring intricate knowledge of the CURL library. This class streamlines the process by providing a range of convenient methods, eliminating the need for directly dealing with CURL.

With this class, developers can effortlessly initiate HTTP requests, regardless of their type, by abstracting away the complexities of CURL. Whether you need to perform GET, POST, PUT, or DELETE requests, this class has you covered. Its intuitive interface empowers developers to communicate with remote servers without delving into the intricate details of the underlying protocol.

By utilizing the "Simple HTTP Request" class, you can focus on the core functionality of your application while leaving the intricacies of HTTP communication to the class itself. This improves code readability, reduces development time, and minimizes potential errors that might arise from manually handling CURL operations.

In summary, the "Simple HTTP Request" class simplifies and enhances the process of sending HTTP requests in PHP, offering a collection of convenience methods that abstract the complexities of CURL. This class is a valuable tool for any developer aiming to streamline server-to-server communication while maintaining a clean and efficient codebase.

How to Use It ?

Method 1 : Direct Usage

  1. Take Pull From : https://github.com/srikant-kumar/simple-http-request
  2. Create Folder in your project with [FOLDER_NAME_YOU_WANT] copy all files into that.
  3. Follow the below code for refrence

Method 2 : Using Composer

  1. Run composer command in your project Directory: composer require srikant-kumar/simple-http-request
  2. Include : vendor/autoload.php
  3. Follow the below code for refrence

Set Request Method & Usages

Other method you can use in your request :

Request Methods Value Option
application/json
application/x-www-form-urlencoded
text/plain
multipart/form-data

Default : multipart/form-data
Required
GET
POST
PUT
PATCH
DELETE

Default : GET
Required
If Request Method is Post Make an Array of post data shown as below
Optional
Make an Array Of Query Pramter

It will produce url with parametrs
Optional
Make an Array of Request Headers shown as below
Optional
Basic Auth : (String) $username & (String) $password Optional
$user_agent : (String) Example : Optional
$cookie_file_path : Absolute path to a txt file where cookie information will be stored. Optional
Disable Cookies : No Parameter Required Optional
For Enabling SSL Check Optional
For Disabling SSL Check Optional
$time : (Int) 10 (in second) Optonal
Final Method For Running the HTTP Request Required

Get Response Method & Usages

Other method you can use after completion of a request : Note : Call this method after $request->run(); Methods Description
Get Response Body from the server
Get Response Header from the server
Get Response Header as Array from the server
Get Content Type that you set on time of request
Get Time Out that you set on time of request
Get Post Fields Array that you set on time of request
Get Query Parameter Array that you set on time of request
Get Request URL that you set on time of request.
If you will set query parameter then you will get REQUEST_URL?query_parameters
Get Response HTTP Code Example : 200 , 401 , 402 , 500 etc..
$unit : (String) ms : stand for MilliSecond
$unit : (String) s : stand for Second
$unit : (String) m : stand for Minute
$unit : (String) h : stand for Hour
Default : ms
Get Error If any by deafult you will get blank string

Why Simple Http Request?

In daily development life we need to call third parties api for the projects. So every time we have to write cURL code that is hard to remember ( I don't know about others but i have problem to remeber the things 😀😀😀 ) that's why i made this package.

It is simple and easy to use.

License

Request is licensed under the MIT


All versions of simple-http-request with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package srikant-kumar/simple-http-request contains the following files

Loading the files please wait ....