19. Class

19.1. Zend\Http\Client\Adapter\Curl

An adapter class for ZendHttpClient based on the curl extension. Curl requires libcurl. See for full requirements the PHP manual: http://php.net/curl

19.1.1. Methods

19.1.1.1. __construct

__construct()

Adapter constructor

Config is set using setOptions()

19.1.1.2. setOptions

setOptions()

Set the configuration array for the adapter

Parameters:array|Traversable
Return type:Curl
Throws :AdapterExceptionInvalidArgumentException

19.1.1.3. getConfig

getConfig()

Retrieve the array of all configuration options

Return type:array

19.1.1.4. setCurlOption

setCurlOption()

Direct setter for cURL adapter related options.

Parameters:
  • string|int
  • mixed
Return type:

Curl

19.1.1.5. connect

connect()

Initialize curl

Parameters:
  • string
  • int
  • bool
Return type:

void

Throws :

AdapterExceptionRuntimeException if unable to connect

19.1.1.6. write

write()

Send request to the remote server

Parameters:
  • string
  • ZendUriUri
  • float
  • array
  • string
Return type:

string $request

Throws :

AdapterExceptionRuntimeException If connection fails, connected to wrong host, no PUT file defined, unsupported method, or unsupported cURL option

Throws :

AdapterExceptionInvalidArgumentException if $method is currently not supported

19.1.1.7. read

read()

Return read response from server

Return type:string

19.1.1.8. close

close()

Close the connection to the server

19.1.1.9. getHandle

getHandle()

Get cUrl Handle

Return type:resource

19.1.1.10. setOutputStream

setOutputStream()

Set output stream for the response

Parameters:resource
Return type:Curl

19.1.1.11. readHeader

readHeader()

Header reader function for CURL

Parameters:
  • resource
  • string
Return type:

int