zzzep/zcurl

`A simple CurlHelper

Maintainers

Details

github.com/zzzep/zcurl

Source

Issues

Installs: 22

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:package

1.0.1 2018-06-06 12:54 UTC

This package is not auto-updated.

Last update: 2025-06-15 12:37:12 UTC


README

PHP Curl Helper

Usage:

GET:
	
	$curl = new CurlHelper();

	$response = $curl->init()->response("http://example.com");


POST:
	
	$curl = new CurlHelper();
	
	$arrayOfParams = array(
		'param1' => 'value1',
		'param2' => 'value2',
	);

	$response = $curl->init()->setPost($arrayOfParams)->response("http://example.com");
	
PUT:
	
	$curl = new CurlHelper();
	
	$arrayOfParams = array(
		'param1' => 'value1',
		'param2' => 'value2',
	);

	$response = $curl->init()->setPost($arrayOfParams)->response("http://example.com");		
	

How to set Header (optional):

	$curl = new CurlHelper();
	
	$headers = array(
		'Content-type: application/json',
		'Authorization: Auth123',
	);
	
	$response = $curl->setHeader($headers)->response("http://example.com");