WebFioriAPI ReferenceLearnDownloadContributeLearn{{result.parent_page}} > {{result.title}}{{result.title}}Classes{{result.class_name}}{{result.summary}}Methods{{result.name}}{{result.summary}}

namespace \webfiori\http

class Request

Class Attributes Summary

const METHODSAn array that contains the names of request methods.

Class Methods Summary

public static function getAuthHeader()Returns an array that contains the value of the header 'authorization'.public static function getClientIP()Returns the IP address of the user who is connected to the server.public static function getContentType()Returns request content type.public static function getHeaders()Returns HTTP request headers.public static function getMethod()Returns the name of request method which is used to call one of the services in the set.public static function getParam(string$paramName)Returns the value of a GET or POST parameter.public static function getRequestedURL()Returns the URI of the requested resource.public static function getUri()Returns an object that holds all information about requested URI.

Class Attributes Details

const METHODSAn array that contains the names of request methods. This array contains the following strings:
  • GET
  • HEAD
  • POST
  • PUT
  • DELETE
  • TRACE
  • OPTIONS
  • PATCH
  • CONNECT

Class Methods Details

public static function getAuthHeader()Returns an array that contains the value of the header 'authorization'. Returns: arrayThe array will have two indices, the first one with name 'scheme' and the second one with name 'credentials'. The index 'scheme' will contain the name of the scheme which is used to authenticate ('Basic', 'Bearer', 'Digest', etc...). The index 'credentials' will contain the credentials which can be used to authenticate the client.public static function getClientIP()Returns the IP address of the user who is connected to the server. Returns: stringThe IP address of the user who is connected to the server. The value is taken from the array $_SERVER at index 'REMOTE_ADDR'.public static function getContentType()Returns request content type. Returns: string|nullThe value of the header 'content-type' in the request.public static function getHeaders()Returns HTTP request headers. This method will try to extract request headers using two ways, first, it will check if the method 'apache_request_headers()' is exist or not. If it does, then request headers will be taken from there. If it does not exist, it will try to extract request headers from the super global $_SERVER.Returns: arrayAn associative array of request headers. The indices will represents the headers and the values are the values of the headers. The indices will be all in lower case.public static function getMethod()Returns the name of request method which is used to call one of the services in the set. Returns: stringRequest method such as POST, GET, etc.... Default return value is 'GET'. The default is usually returned in case the call to this method was performed in CLI environment. To change request method in CLI environment to something like 'POST' for testing, use the function putenv('REQUEST_METHOD=POST').public static function getParam(string$paramName)Returns the value of a GET or POST parameter. This method will apply basic filtering to the value of the parameter before returning it. The developer may need to apply extra filtering to make sure that the value of the parameter is safe to use.

Parameters:

  • string $paramName The name of the parameter. Note that if the value has extra spaces, they will be trimmed.
Returns: string|nullThe method will return the value of the parameter if set as a string. Other than that, the method will return null.
public static function getRequestedURL()Returns the URI of the requested resource. Returns: stringThe URI of the requested resource.public static function getUri()Returns an object that holds all information about requested URI. Returns: Urian object that holds all information about requested URI.
mdi-menuAll Classesmdi-chevron-leftAnchorBrCodeSnippetHTMLDocHTMLListHTMLNodeHTMLTableHeadNodeInputJsCodeLabelListItemOrderedListParagraphRadioGroupTableCellTableRowUnorderedListInvalidNodeNameExceptionTemplateNotFoundExceptionCaseConverterJsonJsonConverterJsonIJsonTypesPropertyAPIFilterAbstractWebServiceManagerInfoServiceParamTypesRequestRequestParameterResponseUriWebServicesManagerAccessAutoLoaderConfigConfigControllerDBEAbstractWebServiceExtendedWebServicesManagerFileLoggerPrivilegePrivilegesGroupThemeThemeLoaderUploadFileUploaderUserUtilWebFioriAppLanguageErrorBoxHTTPCodeViewMessageBoxServerErrViewStarterPageWebPageDatabaseSessionStorageDefaultSessionStorageMSSQLSessionDataTableMSSQLSessionsTableMySQLSessionDataTableMySQLSessionsTableSessionSessionOperationsSessionStorageSessionsManagerRouterRouterUriAbstractMiddlewareMiddlewareManagerEmailMessageSMTPAccountSMTPServerClassLoaderExceptionFileExceptionInitializationExceptionInvalidCRONExprExceptionMissingLangExceptionNoSuchThemeExceptionRoutingExceptionSMTPExceptionSessionExceptionUIExceptionAbstractJobCronCronEmailCronJobJobArgumentCronLoginViewCronTasksViewCronViewCronLoginServiceCronLogoutServiceCronServicesManagerForceCronExecutionServiceGetJobsServiceCLICLICommandInputStreamOutputStreamStdInStdOutClassWriterLangClassWriterQueryClassWriterServiceHolderThemeClassWriterWebServiceWriterCreateCLIClassHelperCreateCronJobCreateMiddlewareCreateTableCreateTableObjCreateThemeHelperCreateWebServiceAddCommandCreateCommandCronCommandHelpCommandListCronCommandListRoutesCommandListThemesCommandRunSQLQueryCommandSettingsCommandTestRouteCommandUpdateSettingsCommandUpdateTableCommandVersionCommandAbstractQueryColumnColumnFactoryConditionConnectionConnectionInfoDatabaseDatabaseExceptionDateTimeValidatorEntityMapperExpressionForeignKeyJoinTableResultSetSelectExpressionTableWhereExpressionMySQLColumnMySQLConnectionMySQLQueryMySQLTableMSSQLColumnMSSQLConnectionMSSQLQueryMSSQLTableAbstractCollectionComparableLinkedListNodeQueueStack
Powered By: WebFiori Framework, Vue and VuetifyAll Rights Reserved © 2018 - 2024