addContent()
public method
Adds a content part for multi-part content request.
public addContent ( string $name, string $content, array $options = [] ) |
$name |
string |
part (form input) name. |
$content |
string |
content. |
$options |
array |
content part options, valid options are:
- contentType - string, part content type
- fileName - string, name of the uploading file
- mimeType - string, part content type in case of file uploading |
addFileContent()
public method
Adds a string as a file upload.
public addFileContent ( string $name, string $content, array $options = [] ) |
$name |
string |
part (form input) name |
$content |
string |
file content. |
$options |
array |
content part options, valid options are:
- fileName - string, base name of the uploading file.
- mimeType - string, file mime type, if not set it 'application/octet-stream' will be used. |
setOptions()
public method
- proxy: string, URI specifying address of proxy server. (e.g. tcp://proxy.example.com:5100).
- userAgent: string, the contents of the "User-Agent: " header to be used in a HTTP request.
- followLocation: bool, whether to follow any "Location: " header that the server sends as part of the HTTP header.
- maxRedirects: int, the max number of redirects to follow.
- protocolVersion: float|string, HTTP protocol version.
- sslVerifyPeer: bool, whether verification of the peer's certificate should be performed.
- sslCafile: string, location of Certificate Authority file on local filesystem which should be used with
the 'sslVerifyPeer' option to authenticate the identity of the remote peer.
- sslCapath: string, a directory that holds multiple CA certificates.
You may set options using keys, which are specific to particular transport, like [CURLOPT_VERBOSE => true] in case
there is a necessity for it.