PHP 클래스 Restagent\Request

For full disclosure this is a shameless rip-off from: https://github.com/inadarei/settee/blob/master/src/classes/ZaphpaRestClient.class.php That is: if you can call "stealing" from one's self "shameless" :)
파일 보기 프로젝트 열기: zaphpa/zaphpa

공개 메소드들

메소드 설명
__construct ( null $base_url = '' ) Public constructor
__destruct ( ) Class destructor cleans up any resources
content_mime_type ( $content ) : void
data ( ) Set a variable (query param or a data var)
delete ( $uri ) HTTP DELETE
file_mime_type ( $path ) : void
get ( $uri ) HTTP GET
head ( $uri ) HTTP HEAD
header ( ) Set an HTTP Head
method ( $method ) : Request Set HTTP method to use with send()
param ( ) Set a query param. This method can/should not be used with HTTP GET! Use var() call instead or you will get an exception
post ( $uri ) HTTP POST
put ( $uri ) HTTP PUT
send ( $uri ) Custom HTTP Method. Use with caution.
timeout ( $ms ) Set curl/http timeout in milliseconds.

비공개 메소드들

메소드 설명
_http_parse_headers ( $header ) : array Backup PHP impl. for when PECL http_parse_headers() function is not available
check_status ( $response, $full_url ) Check http status for safe return codes
get_full_url ( $uri ) Get full URL from a partial one
http_request ( $http_method, $uri, array $data = [] ) Generic implementation of a HTTP Request.

메소드 상세

__construct() 공개 메소드

Public constructor
public __construct ( null $base_url = '' )
$base_url null

__destruct() 공개 메소드

Class destructor cleans up any resources
public __destruct ( )

content_mime_type() 공개 메소드

public content_mime_type ( $content ) : void
$content content of a file in a string buffer format.
리턴 void

data() 공개 메소드

Set a variable (query param or a data var)
public data ( )

delete() 공개 메소드

HTTP DELETE
public delete ( $uri )

file_mime_type() 공개 메소드

public file_mime_type ( $path ) : void
$path Full path to a file (e.g. as returned by PHP's realpath function).
리턴 void

get() 공개 메소드

HTTP GET
public get ( $uri )

head() 공개 메소드

HTTP HEAD
public head ( $uri )

header() 공개 메소드

Set an HTTP Head
public header ( )

method() 공개 메소드

Set HTTP method to use with send()
public method ( $method ) : Request
$method
리턴 Request

param() 공개 메소드

Set a query param. This method can/should not be used with HTTP GET! Use var() call instead or you will get an exception
public param ( )

post() 공개 메소드

HTTP POST
public post ( $uri )

put() 공개 메소드

HTTP PUT
public put ( $uri )

send() 공개 메소드

Custom HTTP Method. Use with caution.
public send ( $uri )
$uri

timeout() 공개 메소드

Set curl/http timeout in milliseconds.
public timeout ( $ms )
$ms