PHP 클래스 Amp\Artax\FormBody

상속: implements Amp\Artax\AggregateBody
파일 보기 프로젝트 열기: amphp/artax 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $boundary = null )
addField ( string $name, string $value, string $contentType = 'text/plain' ) : self Add a data field to the form entity body
addFields ( array $data, string $contentType = 'text/plain' ) : self Add each element of a associative array as a data field to the form entity body
addFile ( string $name, string $filePath, string $contentType = 'application/octet-stream' ) : self Add a file field to the form entity body
addFiles ( array $data, string $contentType = 'application/octet-stream' ) : self Add each element of a associative array as a file field to the form entity body
getBody ( ) : Amp\Promise Retrieve the sendable Amp\Artax entity body representation
getHeaders ( ) : Amp\Promise Retrieve a key-value array of headers to add to the outbound request
getLength ( ) : Amp\Promise Retrieve the content length of the form entity body

비공개 메소드들

메소드 설명
determineContentType ( )
generateMultipartFieldHeader ( $name, $contentType )
generateMultipartFileHeader ( $name, $fileName, $contentType )
generateMultipartIteratorFromFields ( array $fields )
getFormEncodedBodyString ( )
getMultipartFieldArray ( )
sumMultipartFieldLengths ( array $fields )

메소드 상세

__construct() 공개 메소드

public __construct ( string $boundary = null )
$boundary string An optional multipart boundary string

addField() 공개 메소드

Add a data field to the form entity body
public addField ( string $name, string $value, string $contentType = 'text/plain' ) : self
$name string
$value string
$contentType string
리턴 self

addFields() 공개 메소드

Add each element of a associative array as a data field to the form entity body
public addFields ( array $data, string $contentType = 'text/plain' ) : self
$data array
$contentType string
리턴 self

addFile() 공개 메소드

Add a file field to the form entity body
public addFile ( string $name, string $filePath, string $contentType = 'application/octet-stream' ) : self
$name string
$filePath string
$contentType string
리턴 self

addFiles() 공개 메소드

Add each element of a associative array as a file field to the form entity body
public addFiles ( array $data, string $contentType = 'application/octet-stream' ) : self
$data array
$contentType string
리턴 self

getBody() 공개 메소드

AggregateBody::getBody() implementations always return a Promise instance to allow for future resolution of non-blocking operations (e.g. when the entity body comprises filesystem resources).
public getBody ( ) : Amp\Promise
리턴 Amp\Promise

getHeaders() 공개 메소드

AggregateBody::getHeaders() implementations always return a Promise instance to allow for future resolution of non-blocking operations (e.g. when using filesystem stats to generate content-length headers).
public getHeaders ( ) : Amp\Promise
리턴 Amp\Promise

getLength() 공개 메소드

AggregateBody::getLength() implementations always return a Promise instance to allow for future resolution of non-blocking operations (e.g. when using filesystem stats to determine entity body length).
public getLength ( ) : Amp\Promise
리턴 Amp\Promise