public
|
#
__construct( string $uri = null )
Create a new request object.
Create a new request object.
Parameters
|
public
flHttpClient
|
#
setTimeout( integer $timeout )
Set the timeout.
Parameters
- $timeout
- The timeout in seconds.
Returns
|
public
flHttpClient
|
#
setContentType( string $contentType )
Set the content type for the request if no file upload.
Set the content type for the request if no file upload.
Parameters
- $contentType
- The content type.
Returns
|
public
flHttpClient
|
#
setUri( string $uri = null )
Set the URI to access.
Parameters
- $uri
- The URI to access, this may contain a username and password.
Returns
Throws
|
public
flHttpClient
|
#
setMaxSize( integer $size )
Set the maximum size of a page that will be accepted, this has no effect when storing
to disk.
Set the maximum size of a page that will be accepted, this has no effect when storing
to disk.
Parameters
- $size
- The maximum allowed page size in bytes or 0 to allow any size.
Returns
|
public
flHttpClient
|
#
setAuth( string $username, string $password )
Set the username and password to use for authentication.
Set the username and password to use for authentication.
Parameters
- $username
- The username to use.
- $password
- The password to use.
Returns
|
public
flHttpClient
|
#
clearAuth( )
Clear the authentication information.
Clear the authentication information.
Returns
|
public
flHttpClient
|
#
addPostData( string $name, string $value )
Add a value to post during the request.
Add a value to post during the request.
Parameters
- $name
- The name of the value
- $value
- The value to post.
Returns
|
public
flHttpClient
|
#
removePostData( string $name )
Remove a post value.
Parameters
- $name
- The name of the post value to remove.
Returns
|
public
flHttpClient
|
#
clearPostData( )
Clear all post data.
Returns
|
public
flHttpClient
|
#
setPostData( array $data )
Set the data to post during the request, all existing data is replaced.
Set the data to post during the request, all existing data is replaced.
Parameters
- $data
- Array of name value pairs for the data to send, or string of data only if not uploading files.
Returns
|
public
flHttpClient
|
#
addQueryData( string $name, string $value )
Add a value to query string.
Add a value to query string.
Parameters
- $name
- The name of the value
- $value
- The value to add.
Returns
|
public
flHttpClient
|
#
removeQueryData( string $name )
Remove a query value.
Parameters
- $name
- The name of the query value to remove.
Returns
|
public
flHttpClient
|
#
clearQueryData( )
Clear all query data.
Returns
|
public
flHttpClient
|
#
setQueryData( array $data )
Set the query string data to use during the request, all existing data is replaced.
Set the query string data to use during the request, all existing data is replaced.
Parameters
- $data
- Array of name value pairs for the data to send.
Returns
|
public
flHttpClient
|
#
addFile( string $name, string $file, string $mimeType = null, string $data = null )
Add a file to be posted.
Parameters
- $name
- The name to send the file as.
- $file
- The path to the file to send in the post.
- $mimeType
- The mime type of the file or null to autodetect from the file extension.
- $data
- If present then this is sent as the file contents, if null then the contents are loaded from the file.
Returns
|
public
flHttpClient
|
#
removeFile( string $name )
Remove the named file.
Parameters
- $name
- The name of the file to remove.
Returns
|
public
flHttpClient
|
#
clearFiles( )
Remove all the files.
Returns
|
public
flHttpClient
|
#
followRedirects( boolean $follow )
Flags if redirects should be followed.
Flags if redirects should be followed.
Parameters
- $follow
- True if redirects should be followed or false if not.
Returns
|
public
flHttpClient
|
#
addCookie( flHttpClientCookie $cookie )
Add a cookie to use with requests.
Add a cookie to use with requests.
Parameters
Returns
|
public
flHttpClient
|
#
clearCookies( )
Remove all cookies.
Returns
|
public
array
|
#
getCookies( )
Get an array of the cookies set by the server.
Get an array of the cookies set by the server.
Returns
array Array of all cookies [domain][path][name] => flHttpClientCookie
|
public
flHttpClient
|
#
setCookies( array $cookies )
Set all cookies replacing any existing.
Set all cookies replacing any existing.
Parameters
- $cookies
- Array of cookies [domain][path][name] => flHttpClientCookie
Returns
|
public
flHttpClient
|
#
ignoreCookies( boolean $ingoreCookies )
Flags if cookies sent from the server should be ignored or accepted.
Flags if cookies sent from the server should be ignored or accepted.
Parameters
- $ingoreCookies
- True if cookies should be accepted or false to ignore them.
Returns
|
public
boolean
|
#
sendRequest( string $method = null )
Send the request.
Parameters
- $method
- The method to use for the request of null to auto select POST or GET.
Returns
boolean true if the request was sent or false if an error occurred.
|
public
string
|
#
getBody( )
Return the page body loaded from the last request.
Return the page body loaded from the last request.
Returns
string The page body.
|
public
integer
|
#
getResponseCode( )
Get the response code from the last request.
Get the response code from the last request.
Returns
integer The response code.
|