https://github.com/yakeing/php_curl
Curl is an open source file transfer tool that uses URL syntax to work on the command line, where the basic functions of curl are encapsulated, such as COOKIES / encrypted transport / HTTP authentication / analog forms / upload files, etc.
https://github.com/yakeing/php_curl
curl http post
Last synced: 2 months ago
JSON representation
Curl is an open source file transfer tool that uses URL syntax to work on the command line, where the basic functions of curl are encapsulated, such as COOKIES / encrypted transport / HTTP authentication / analog forms / upload files, etc.
- Host: GitHub
- URL: https://github.com/yakeing/php_curl
- Owner: yakeing
- License: mpl-2.0
- Created: 2017-07-21T11:42:51.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2021-05-16T06:09:48.000Z (almost 5 years ago)
- Last Synced: 2025-08-02T23:52:03.086Z (7 months ago)
- Topics: curl, http, post
- Language: PHP
- Homepage:
- Size: 68.4 KB
- Stars: 36
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Curl
Curl is an open source file transfer tool that uses URL syntax to work on the command line, where the basic functions of curl are encapsulated, such as COOKIES / encrypted transport / HTTP authentication / analog forms / upload files, etc.
### Travis CI badge
[](https://travis-ci.com/yakeing/php_curl)
### codecov badge
[](https://codecov.io/gh/yakeing/php_curl)
### Github badge
[](../../)
[](src)
[](../../releases)
[](LICENSE)
[](../../search?l=php)
### Installation
Use [Composer](https://getcomposer.org) to install the library.
Of course, You can go to [Packagist](https://packagist.org/packages/yakeing/php_curl) to view.
```
$ composer require yakeing/php_curl
```
### init
- [x] example
```php
$Curl = new curl();
$curl->Encoding = 'gzip';
$Curl->Timeout = 10;
```
### GET
- [x] example
```php
$Url = 'https://github.com/yakeing';
$Header = array(
'User-Agent: Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.28'
);
$Curl->Get($Url, $Header);
```
### POST
- [x] example
```php
$Url = 'https://github.com/yakeing';
$Vars = array(
'user'=>'admin',
'upload'=>new CURLFile(realpath('image.jpg')) //php 5.5 Edition
);
$curl->UserAgent = 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.28';
$Curl->Post($Url, $Vars, $Header);
```
[Sponsor](https://github.com/yakeing/Documentation/blob/master/Sponsor/README.md)
---
If you've got value from any of the content which I have created, then I would very much appreciate your support by payment donate.
[](https://github.com/yakeing/Documentation/blob/master/Sponsor/README.md)
Author
---
weibo: [yakeing](https://weibo.com/yakeing)
twitter: [yakeing](https://twitter.com/yakeing)