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|nullThe charset attribute for the Content-Disposition header fields
string|nullThe contentId for the part
stringDisposition to send
string|nullFilename to send if using files.
stringName of the value.
string|nullThe encoding used in this part.
string|nullContent type to use
stringValue to send.
Constructor
Convert the part into a string.
Get the string for the header parameter.
Get/set the contentId for a part.
Get/set the disposition type
Get/set the filename.
Get the part name.
Set the transfer-encoding for multipart.
Get/set the content type.
Get the value.
__construct(string $name, string $value, string $disposition = 'form-data', string|null $charset = null)
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(): string
Convert the part into a string.
Creates a string suitable for use in HTTP requests.
string_headerParameterToString(string $name, string $value): string
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
stringcontentId(string|null $id = null): string|null
Get/set the contentId for a part.
string|null $id optional The content id.
string|nulldisposition(string|null $disposition = null): string
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.
stringfilename(string|null $filename = null): string|null
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|nullname(): string
Get the part name.
stringtransferEncoding(string|null $type): string|null
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|nulltype(string|null $type): string|null
Get/set the content type.
string|null $type Use null to get/string to set.
string|nullvalue(): string
Get the value.
stringThe charset attribute for the Content-Disposition header fields
string|nullThe contentId for the part
string|nullDisposition to send
stringFilename to send if using files.
string|nullName of the value.
stringThe encoding used in this part.
string|nullContent type to use
string|nullValue 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.4/class-Cake.Http.Client.FormDataPart.html