Contains the data and behavior for a single part in a Multipart FormData request body.
Added to Cake\Http\Client\FormData when sending data to a remote server.
string|null
The charset attribute for the Content-Disposition header fields
string|null
The contentId for the part
string
Disposition to send
string|null
Filename to send if using files.
string
Name of the value.
string|null
The encoding used in this part.
string|null
Content type to use
string
Value to send.
__construct(string $name, string $value, string $disposition, ?string $charset)
Constructor
string
$name The name of the data.
string
$value The value of the data.
string
$disposition optional The type of disposition to use, defaults to form-data.
string|null
$charset optional The charset of the data.
__toString()
Convert the part into a string.
Creates a string suitable for use in HTTP requests.
string
_headerParameterToString(string $name, string $value)
Get the string for the header parameter.
If the value contains non-ASCII letters an additional header indicating the charset encoding will be set.
string
$name The name of the header parameter
string
$value The value of the header parameter
string
contentId(?string $id)
Get/set the contentId for a part.
string|null
$id optional The content id.
string|null
disposition(?string $disposition)
Get/set the disposition type
By passing in false
you can disable the disposition header from being added.
string|null
$disposition optional Use null to get/string to set.
string
filename(?string $filename)
Get/set the filename.
Setting the filename to false
will exclude it from the generated output.
string|null
$filename optional Use null to get/string to set.
string|null
name()
Get the part name.
string
transferEncoding(?string $type)
Set the transfer-encoding for multipart.
Useful when content bodies are in encodings like base64.
string|null
$type The type of encoding the value has.
string|null
type(?string $type)
Get/set the content type.
string|null
$type Use null to get/string to set.
string|null
value()
Get the value.
string
The charset attribute for the Content-Disposition header fields
string|null
The contentId for the part
string|null
Disposition to send
string
Filename to send if using files.
string|null
Name of the value.
string
The encoding used in this part.
string|null
Content type to use
string|null
Value to send.
string
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Http.Client.FormDataPart.html