\Teknoo\CurlRequestInterface

Interface RequestInterface Interface to define class to represent a request, aka a curl instance.

Summary

Methods
Constants
getHandle()
setOption()
setOptionArray()
execute()
setReturnValue()
setUrl()
getInfo()
setMethod()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getHandle()

getHandle() : resource

Getter for the internal curl handle resource.

Returns

resource —

the curl handle

setOption()

setOption(integer  $option, mixed  $value) : $this

Alias of the curl_setopt function.

Parameters

integer $option

Option defined in http://php.net/manual/function.curl-setopt.php

mixed $value

Throws

\InvalidArgumentException

if the option does not exist or if it is invalid

Returns

$this

execute()

execute() : mixed

Execute the cURL request.

Throws

\Teknoo\Curl\ErrorException

Returns

mixed —

the results of curl_exec

setReturnValue()

setReturnValue(boolean  $enable) : $this

To return the transfer as a string of the return value of execute() instead of outputting it out directly.

Parameters

boolean $enable

Returns

$this

setUrl()

setUrl(string  $url) : $this

Method to define url to call.

Parameters

string $url

Returns

$this

setMethod()

setMethod(string  $method) : $this

Convenience method for setting the appropriate cURL options based on the desired HTTP request method.

Parameters

string $method

Returns

$this