本文整理汇总了C++中PHTTP_BMO_REQ_OBJECT::GetMethod方法的典型用法代码示例。如果您正苦于以下问题:C++ PHTTP_BMO_REQ_OBJECT::GetMethod方法的具体用法?C++ PHTTP_BMO_REQ_OBJECT::GetMethod怎么用?C++ PHTTP_BMO_REQ_OBJECT::GetMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHTTP_BMO_REQ_OBJECT
的用法示例。
在下文中一共展示了PHTTP_BMO_REQ_OBJECT::GetMethod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
ANSC_STATUS
WebRooProcess
(
ANSC_HANDLE hThisObject,
ANSC_HANDLE hBmoReq,
ANSC_HANDLE hBmoRep
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PWEB_RESOURCE_OWNER_OBJECT pMyObject = (PWEB_RESOURCE_OWNER_OBJECT )hThisObject;
PWEB_RESOURCE_OWNER_PROPERTY pProperty = (PWEB_RESOURCE_OWNER_PROPERTY)&pMyObject->Property;
PHTTP_RCP_INTERFACE pRcpIf = (PHTTP_RCP_INTERFACE )pMyObject->hRcpIf;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )hBmoReq;
PHTTP_BMO_REP_OBJECT pBmoRep = (PHTTP_BMO_REP_OBJECT )hBmoRep;
PHTTP_REQUEST_INFO pReqInfo = (PHTTP_REQUEST_INFO )pBmoReq->GetReqInfo ((ANSC_HANDLE)pBmoReq);
PANSC_TOKEN_CHAIN pPathTokenChain = (PANSC_TOKEN_CHAIN )pBmoReq->GetRecvContext((ANSC_HANDLE)pBmoReq);
PWEB_GENERAL_SESSION_OBJECT pSession = (PWEB_GENERAL_SESSION_OBJECT )pBmoRep->GetRecvContext((ANSC_HANDLE)pBmoRep);
PWEB_AUTH_SERVER_OBJECT pAuthServer = (PWEB_AUTH_SERVER_OBJECT )pMyObject->hAuthServer;
BOOL bAuthenticated = TRUE;
pBmoReq->SetRcpIf ((ANSC_HANDLE)pBmoReq, (ANSC_HANDLE)pRcpIf );
pBmoRep->SetWebServlet((ANSC_HANDLE)pBmoReq, (ANSC_HANDLE)pMyObject);
if ( pReqInfo->MajorVersion != HTTP_CURRENT_MAJOR_VERSION )
{
returnStatus =
pMyObject->ReplyReq
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep,
HTTP_STATUS_VERSION_NOT_SUPPORTED,
(ANSC_HANDLE)NULL
);
goto EXIT1;
}
if ( pAuthServer )
{
returnStatus =
pAuthServer->AuthenticateReq
(
(ANSC_HANDLE)pAuthServer,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
);
bAuthenticated = ( returnStatus == ANSC_STATUS_SUCCESS );
returnStatus = ANSC_STATUS_SUCCESS;
}
if ( bAuthenticated )
{
switch ( pBmoReq->GetMethod((ANSC_HANDLE)pBmoReq) )
{
case HTTP_METHOD_CODE_OPTIONS :
returnStatus =
pMyObject->DoOptions
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
);
break;
case HTTP_METHOD_CODE_GET :
returnStatus =
pMyObject->DoGet
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
);
break;
case HTTP_METHOD_CODE_HEAD :
returnStatus =
pMyObject->DoHead
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
);
break;
case HTTP_METHOD_CODE_POST :
returnStatus =
pMyObject->DoPost
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
//.........这里部分代码省略.........
示例2: if
ANSC_STATUS
HttpBmoSaveFormAsFile
(
ANSC_HANDLE hThisObject,
char* param_name,
char* file_name,
BOOL bFlushBody
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_BASIC_MESSAGE_OBJECT pMyObject = (PHTTP_BASIC_MESSAGE_OBJECT)hThisObject;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )pMyObject;
PHTTP_HFP_INTERFACE pHfpIf = (PHTTP_HFP_INTERFACE )pMyObject->hHfpIf;
PHTTP_TMH_INTERFACE pTmhIf = (PHTTP_TMH_INTERFACE )pMyObject->hTmhIf;
PHTTP_BCC_INTERFACE pBccIf = (PHTTP_BCC_INTERFACE )pMyObject->hBccIf;
PHTTP_RCP_INTERFACE pRcpIf = (PHTTP_RCP_INTERFACE )pBmoReq->hRcpIf;
PHTTP_FUM_INTERFACE pFumIf = (PHTTP_FUM_INTERFACE )pMyObject->hFumIf;
PHTTP_MDH_INTERFACE pMdhIf = (PHTTP_MDH_INTERFACE )NULL;
PHTTP_MESSAGE_BODY_OBJECT pMessageBody = (PHTTP_MESSAGE_BODY_OBJECT )pMyObject->hMessageBody;
char* pBoundaryStr = NULL;
ULONG ulEncType = HTTP_HFP_FORM_ENCTYPE_URLENCODED;
ULONG ulMediaType = IANA_MEDIA_TYPE_CODE_APPLICATION;
ULONG ulSubType = IANA_MT_AP_STYPE_CODE_X_FORM_URLENCODED;
char* pReqUri = pRcpIf->GetPathInfo(pRcpIf->hOwnerContext, (ANSC_HANDLE)pMyObject);
pMdhIf = (PHTTP_MDH_INTERFACE)pFumIf->GetMdhIf(pFumIf->hOwnerContext, pReqUri);
if ( pMdhIf )
{
return
pMdhIf->SaveFileAs
(
pMdhIf->hOwnerContext,
pBmoReq->GetWebSessionId((ANSC_HANDLE)pBmoReq),
pReqUri,
param_name,
file_name
);
}
if ( !pMessageBody || (pMyObject->Oid != HTTP_BMO_REQ_OID) )
{
return ANSC_STATUS_UNAPPLICABLE;
}
else if ( pBmoReq->GetMethod((ANSC_HANDLE)pBmoReq) != HTTP_METHOD_CODE_POST )
{
return ANSC_STATUS_UNAPPLICABLE;
}
if ( TRUE )
{
returnStatus =
HttpBmoReqCgiGetContentType
(
(ANSC_HANDLE)pBmoReq,
&ulMediaType,
&ulSubType
);
if ( (ulMediaType == IANA_MEDIA_TYPE_CODE_APPLICATION ) &&
(ulSubType == IANA_MT_AP_STYPE_CODE_X_FORM_URLENCODED) )
{
ulEncType = HTTP_HFP_FORM_ENCTYPE_URLENCODED;
}
else if ( (ulMediaType == IANA_MEDIA_TYPE_CODE_MULTIPART ) &&
(ulSubType == IANA_MT_MP_STYPE_CODE_FORM_DATA) )
{
ulEncType = HTTP_HFP_FORM_ENCTYPE_MULTIPART;
pBoundaryStr = HttpBmoReqCgiGetBoundaryDelimiter((ANSC_HANDLE)pBmoReq);
if ( !pBoundaryStr )
{
return ANSC_STATUS_UNAPPLICABLE;
}
}
else
{
return ANSC_STATUS_UNAPPLICABLE;
}
}
returnStatus =
pHfpIf->SaveFormPartAsFile
(
pHfpIf->hOwnerContext,
param_name,
file_name,
ulEncType,
pBoundaryStr,
(ANSC_HANDLE)pMessageBody,
bFlushBody
);
if ( pBoundaryStr )
{
AnscFreeMemory(pBoundaryStr);
}
return returnStatus;
}