Download the PHP package rakit/curl without Composer

On this page you can find all versions of the php package rakit/curl. 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 curl

rakit-curl

Just another PHP cURL wrapper

Installation

As you can see, this library contain composer.json file. But at this time, i have not post this library on packagist. So if you want to use it via composer, you can manually add this repository in your composer.json file.

So, your composer.json file should look like this:

Then you can run composer install or composer update.

Optionally you can download/clone this library and load it into your project.

Examples

Example Get Request

Using Request Parameter

or

Example Post Request

Upload file? use addFile method

Send a cookie

Auto Redirect

Auto redirect allow cURL to auto redirect while response is redirection (status: 3xx).

Example:

Storing Session

It is easy way to store session automatically with CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE. It is useful when you want to grab something that require session cookies to login or anything else. For use this, you must have directory that have access to write file for storing session.

For example you want grab redirected page after login:

Create Simple Request

With simple request, you dont't need to create new Curl request object. But you can't send a cookie, modify request headers, or even curl options.

Response Object

In examples above, i always told you to do something with response object, but what it is? what you can do with response object?

Response object is object that returned from your cURL request. Response object contain result data from HTTP response such as response headers, cookies, body, etc.

Here is that you can do with response object:

isNotFound()

Shortcut for check response status code is 404 or not.

isRedirect()

Return true if status code is 3xx.

getBody()

Getting response body like html code, image content, etc.

length()

Getting response length (response body string + response header string).

isHtml()

Return true if response content-type is text/html.

error()

Return true if there is error in request

getErrno()

Getting error code, 0 = no error.

getErrorMessage()

Getting error message, empty if no error

getHeader($key, $default = null)

Getting header item

getHeaders()

Getting all header items as array.

getHeaderString()

Get response headers as raw header string.

getStatusCode()

Getting response status code.

getContentType()

Shortcut for getting response content-type.

getInfo($key, $default = null)

Getting info item like curl_getinfo()

getAllInfo()

Getting all info as array.


All versions of curl 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 rakit/curl contains the following files

Loading the files please wait ....